Browse Source

Rename field type to agreement_type

Small fix in view
pull/95/head
Alexis de Lattre 7 years ago
parent
commit
a6a96f0b61
  1. 12
      agreement_account/demo/demo.xml
  2. 2
      agreement_account/models/agreement.py
  3. 8
      agreement_account/views/account_invoice.xml
  4. 16
      agreement_account/views/agreement.xml
  5. 2
      agreement_sale/views/agreement.xml
  6. 4
      agreement_sale/views/sale_order.xml

12
agreement_account/demo/demo.xml

@ -11,7 +11,7 @@
<field name="code">C2C-IT0042</field> <field name="code">C2C-IT0042</field>
<field name="name">Hardware IT</field> <field name="name">Hardware IT</field>
<field name="partner_id" ref="base.res_partner_12"/> <field name="partner_id" ref="base.res_partner_12"/>
<field name="type">sale</field>
<field name="agreement_type">sale</field>
<field name="signature_date">2017-09-10</field> <field name="signature_date">2017-09-10</field>
</record> </record>
@ -19,7 +19,7 @@
<field name="code">C2C-IT0043</field> <field name="code">C2C-IT0043</field>
<field name="name">Fiber access office Lausanne</field> <field name="name">Fiber access office Lausanne</field>
<field name="partner_id" ref="base.res_partner_12"/> <field name="partner_id" ref="base.res_partner_12"/>
<field name="type">sale</field>
<field name="agreement_type">sale</field>
<field name="signature_date" eval="time.strftime('%Y-01-01')"/> <field name="signature_date" eval="time.strftime('%Y-01-01')"/>
</record> </record>
@ -27,7 +27,7 @@
<field name="code">AGR-VETO001</field> <field name="code">AGR-VETO001</field>
<field name="name">Vétérinaire</field> <field name="name">Vétérinaire</field>
<field name="partner_id" ref="base.res_partner_2"/> <field name="partner_id" ref="base.res_partner_2"/>
<field name="type">sale</field>
<field name="agreement_type">sale</field>
<field name="signature_date">2017-08-01</field> <field name="signature_date">2017-08-01</field>
</record> </record>
@ -35,7 +35,7 @@
<field name="code">AGR-TEL001</field> <field name="code">AGR-TEL001</field>
<field name="name">Wazo IPBX deployment and maintenance</field> <field name="name">Wazo IPBX deployment and maintenance</field>
<field name="partner_id" ref="base.res_partner_2"/> <field name="partner_id" ref="base.res_partner_2"/>
<field name="type">sale</field>
<field name="agreement_type">sale</field>
<field name="signature_date">2017-05-05</field> <field name="signature_date">2017-05-05</field>
</record> </record>
@ -43,7 +43,7 @@
<field name="code">BUY-VOIP012</field> <field name="code">BUY-VOIP012</field>
<field name="name">SIP Phones supply</field> <field name="name">SIP Phones supply</field>
<field name="partner_id" ref="base.res_partner_1"/> <field name="partner_id" ref="base.res_partner_1"/>
<field name="type">purchase</field>
<field name="agreement_type">purchase</field>
<field name="signature_date" eval="time.strftime('%Y-01-01')"/> <field name="signature_date" eval="time.strftime('%Y-01-01')"/>
</record> </record>
@ -51,7 +51,7 @@
<field name="code">BUY-VOIP013</field> <field name="code">BUY-VOIP013</field>
<field name="name">SIP-ISDN gateways</field> <field name="name">SIP-ISDN gateways</field>
<field name="partner_id" ref="base.res_partner_3"/> <field name="partner_id" ref="base.res_partner_3"/>
<field name="type">purchase</field>
<field name="agreement_type">purchase</field>
<field name="signature_date">2017-09-02</field> <field name="signature_date">2017-09-02</field>
</record> </record>

2
agreement_account/models/agreement.py

@ -13,7 +13,7 @@ class Agreement(models.Model):
code = fields.Char( code = fields.Char(
string='Code', required=True, copy=False) string='Code', required=True, copy=False)
name = fields.Char(string='Name', required=True) name = fields.Char(string='Name', required=True)
type = fields.Selection([
agreement_type = fields.Selection([
('sale', 'Sale'), ('sale', 'Sale'),
('purchase', 'Purchase'), ('purchase', 'Purchase'),
], string='Type', required=True) ], string='Type', required=True)

8
agreement_account/views/account_invoice.xml

@ -14,8 +14,8 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//page/group/group/field[@name='name']" position="after"> <xpath expr="//page/group/group/field[@name='name']" position="after">
<field name="agreement_id" <field name="agreement_id"
domain="[('partner_id', 'child_of', commercial_partner_id), ('type', '=', 'sale')]"
context="{'default_partner_id': commercial_partner_id, 'default_type': 'sale'}"/>
domain="[('partner_id', 'child_of', commercial_partner_id), ('agreement_type', '=', 'sale')]"
context="{'default_partner_id': commercial_partner_id, 'default_agreement_type': 'sale'}"/>
<field name="commercial_partner_id" invisible="1"/> <field name="commercial_partner_id" invisible="1"/>
</xpath> </xpath>
</field> </field>
@ -28,8 +28,8 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//page/group/group/field[@name='company_id']" position="after"> <xpath expr="//page/group/group/field[@name='company_id']" position="after">
<field name="agreement_id" <field name="agreement_id"
domain="[('partner_id', 'child_of', commercial_partner_id), ('type', '=', 'purchase')]"
context="{'default_partner_id': commercial_partner_id, 'default_type': 'purchase'}"/>
domain="[('partner_id', 'child_of', commercial_partner_id), ('agreement_type', '=', 'purchase')]"
context="{'default_partner_id': commercial_partner_id, 'default_agreement_type': 'purchase'}"/>
<field name="commercial_partner_id" invisible="1"/> <field name="commercial_partner_id" invisible="1"/>
</xpath> </xpath>
</field> </field>

16
agreement_account/views/agreement.xml

@ -23,14 +23,14 @@
<field name="partner_id"/> <field name="partner_id"/>
<field name="name"/> <field name="name"/>
<field name="code"/> <field name="code"/>
<field name="type"/>
<field name="agreement_type"/>
<field name="signature_date"/> <field name="signature_date"/>
<field name="company_id" groups="base.group_multi_company"/> <field name="company_id" groups="base.group_multi_company"/>
</group> </group>
<group string="Customer Invoices" name="out_invoices" attrs="{'invisible': [('type', '!=', 'sale')]}">
<group string="Customer Invoices" name="out_invoices" attrs="{'invisible': [('agreement_type', '!=', 'sale')]}">
<field name="out_invoice_ids" nolabel="1"/> <field name="out_invoice_ids" nolabel="1"/>
</group> </group>
<group string="Supplier Invoices" name="in_invoices" attrs="{'invisible': [('type', '!=', 'purchase')]}">
<group string="Supplier Invoices" name="in_invoices" attrs="{'invisible': [('agreement_type', '!=', 'purchase')]}">
<field name="in_invoice_ids" nolabel="1"/> <field name="in_invoice_ids" nolabel="1"/>
</group> </group>
</form> </form>
@ -45,7 +45,7 @@
<field name="partner_id"/> <field name="partner_id"/>
<field name="code"/> <field name="code"/>
<field name="name"/> <field name="name"/>
<field name="type"/>
<field name="agreement_type"/>
<field name="signature_date"/> <field name="signature_date"/>
<field name="company_id" groups="base.group_multi_company"/> <field name="company_id" groups="base.group_multi_company"/>
</tree> </tree>
@ -59,8 +59,8 @@
<search string="Search Agreements"> <search string="Search Agreements">
<field name="name" filter_domain="['|', ('name', 'ilike', self), ('code', 'ilike', self)]" string="Name or Number"/> <field name="name" filter_domain="['|', ('name', 'ilike', self), ('code', 'ilike', self)]" string="Name or Number"/>
<field name="partner_id"/> <field name="partner_id"/>
<filter name="sale" string="Sale" domain="[('type', '=', 'sale')]"/>
<filter name="purchase" string="Purchase" domain="[('type', '=', 'purchase')]"/>
<filter name="sale" string="Sale" domain="[('agreement_type', '=', 'sale')]"/>
<filter name="purchase" string="Purchase" domain="[('agreement_type', '=', 'purchase')]"/>
<separator/> <separator/>
<filter name="inactive" string="Archived" domain="[('active', '=', False)]"/> <filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
<group name="groupby"> <group name="groupby">
@ -68,8 +68,8 @@
context="{'group_by': 'partner_id'}"/> context="{'group_by': 'partner_id'}"/>
<filter name="signature_date_groupby" string="Signature Date" <filter name="signature_date_groupby" string="Signature Date"
context="{'group_by': 'signature_date'}"/> context="{'group_by': 'signature_date'}"/>
<filter name="type_groupby" string="Type"
context="{'group_by': 'type'}"/>
<filter name="agreement_type_groupby" string="Type"
context="{'group_by': 'agreement_type'}"/>
</group> </group>
</search> </search>
</field> </field>

2
agreement_sale/views/agreement.xml

@ -13,7 +13,7 @@
<field name="inherit_id" ref="agreement_account.agreement_form"/> <field name="inherit_id" ref="agreement_account.agreement_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<group name="in_invoices" position="after"> <group name="in_invoices" position="after">
<group name="sale_orders" string="Sales Orders">
<group name="sale_orders" string="Sales Orders" attrs="{'invisible': [('agreement_type', '!=', 'sale')]}">
<field name="sale_ids" nolabel="1"/> <field name="sale_ids" nolabel="1"/>
</group> </group>
</group> </group>

4
agreement_sale/views/sale_order.xml

@ -14,8 +14,8 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="client_order_ref" position="after"> <field name="client_order_ref" position="after">
<field name="agreement_id" <field name="agreement_id"
domain="[('partner_id', 'child_of', commercial_partner_id), ('type', '=', sale')]"
context="{'default_partner_id': commercial_partner_id, 'default_type', 'sale'}"/>
domain="[('partner_id', 'child_of', commercial_partner_id), ('agreement_type', '=', 'sale')]"
context="{'default_partner_id': commercial_partner_id, 'default_agreement_type': 'sale'}"/>
</field> </field>
</field> </field>
</record> </record>

Loading…
Cancel
Save