-
Notifications
You must be signed in to change notification settings - Fork 25
/
demo.xml
74 lines (64 loc) · 3.22 KB
/
demo.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2020 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<!-- Nouveau -->
<record id="my_new_product" model="product.product">
<!-- Ajout sur existant -->
<record id="product.product_product_25" model="product.product">
<!-- Boolean -->
<!-- WARNING : ne pas mettre <field >0</field> à la place de eval="False"
sinon ça ne marche pas -->
<field name="event_ok" eval="True"/>
<!-- String -->
<field name="name">RAM SR3</field>
<!-- Integer ou float -->
<field name="standard_price">80.0</field>
<!-- Fields.selection string -->
<field name="type">consu</field>
<!-- Fields.selection integer -->
<field name="default_intrastat_transport" eval="int(3)" />
<!-- M2O -->
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="journal_id" model="account.journal"
search="[('type', '=', 'bank'), ('company_id', '=', ref('base.main_company'))]"/>
<!-- date -->
<!-- pour du relatif -->
<field name="membership_date_from" eval="time.strftime('%Y-01-01')" />
<!-- pour du fixe -->
<field name="membership_date_from">2014-09-01</field>
<!-- Datetime -->
<field name="date" eval="time.strftime('%Y-%m-28 15:40:00')"/>
<field name="date_invoice" eval="(datetime.now() + relativedelta(day=5, months=-1)).strftime('%Y-%m-%d')"/>
<!-- M2M -->
<field name="company_ids" eval="[(4, ref('main_company'))]"/>
<field name="groups_id" eval="[(4, ref('stock.group_stock_manager')), (4, ref('account.group_account_invoice')), (4, ref('account.group_account_user')), (4, ref('account.group_account_manager'))]"/>
</record>
<!-- Mettre une propriété en donnée de demo EN VERSION 8 -->
<record id="property_account_payable" model="ir.property" forcecreate="True">
<field name="name">property_account_payable</field>
<field name="fields_id" search="[('model','=','res.partner'),('name','=','property_account_payable')]"/>
<field name="type">many2one</field> <!-- mettre le type du champ indiqué dans fields_id -->
<field name="value" eval="'payment.mode,'+str(ref('account_banking_payment_export.payment_mode_2'))"/> <!-- si c'est un selection : eval="'picking'" -->
<field name="company_id" ref="base.main_company"/>
<!-- Si pas de valeur pour res_id => ce bloc devient la définition de la valeur par défaut -->
<field name="res_id" ref=""/>
</record>
<!-- Champ property EN VERSION 9 -->
<record id="base.res_partner_2" model="res.partner">
<field name="customer_payment_mode" ref="account_payment_mode.payment_mode_inbound_dd1"/>
</record>
<!-- Faire franchir une transition de workflow -->
<workflow action="invoice_open" model="account.invoice" ref="invoice_1"/>
<!-- invoice_open = signal de la transition de workflow ; ref=xmlid de la facture-->
<!-- Ajouter l'admin dans le groupe -->
<record id="base.user_root" model="res.users">
<field name="groups_id" eval="[(4, ref('group_donation_user'))]"/>
</record>
<record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4, ref('group_donation_user'))]"/>
</record>
</odoo>