mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-21 22:52:04 +02:00
Initial commit: Core packages
This commit is contained in:
commit
12c29a983b
9512 changed files with 8379910 additions and 0 deletions
24
odoo-bringout-oca-ocb-mail/mail/static/src/models/country.js
Normal file
24
odoo-bringout-oca-ocb-mail/mail/static/src/models/country.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { registerModel } from '@mail/model/model_core';
|
||||
import { attr } from '@mail/model/model_field';
|
||||
import { clear } from '@mail/model/model_field_command';
|
||||
|
||||
registerModel({
|
||||
name: 'Country',
|
||||
fields: {
|
||||
code: attr(),
|
||||
flagUrl: attr({
|
||||
compute() {
|
||||
if (!this.code) {
|
||||
return clear();
|
||||
}
|
||||
return `/base/static/img/country_flags/${this.code}.png`;
|
||||
},
|
||||
}),
|
||||
id: attr({
|
||||
identifying: true,
|
||||
}),
|
||||
name: attr(),
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue