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="name">Hardware IT</field>
<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>
</record>
@ -19,7 +19,7 @@
<field name="code">C2C-IT0043</field>
<field name="name">Fiber access office Lausanne</field>
<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')"/>
</record>
@ -27,7 +27,7 @@
<field name="code">AGR-VETO001</field>
<field name="name">Vétérinaire</field>
<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>
</record>
@ -35,7 +35,7 @@
<field name="code">AGR-TEL001</field>
<field name="name">Wazo IPBX deployment and maintenance</field>
<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>
</record>
@ -43,7 +43,7 @@
<field name="code">BUY-VOIP012</field>
<field name="name">SIP Phones supply</field>
<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')"/>
</record>
@ -51,7 +51,7 @@
<field name="code">BUY-VOIP013</field>
<field name="name">SIP-ISDN gateways</field>
<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>
</record>

2
agreement_account/models/agreement.py

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

8
agreement_account/views/account_invoice.xml

@ -14,8 +14,8 @@
<field name="arch" type="xml">
<xpath expr="//page/group/group/field[@name='name']" position="after">
<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"/>
</xpath>
</field>
@ -28,8 +28,8 @@
<field name="arch" type="xml">
<xpath expr="//page/group/group/field[@name='company_id']" position="after">
<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"/>
</xpath>
</field>

16
agreement_account/views/agreement.xml

@ -23,14 +23,14 @@
<field name="partner_id"/>
<field name="name"/>
<field name="code"/>
<field name="type"/>
<field name="agreement_type"/>
<field name="signature_date"/>
<field name="company_id" groups="base.group_multi_company"/>
</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"/>
</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"/>
</group>
</form>
@ -45,7 +45,7 @@
<field name="partner_id"/>
<field name="code"/>
<field name="name"/>
<field name="type"/>
<field name="agreement_type"/>
<field name="signature_date"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
@ -59,8 +59,8 @@
<search string="Search Agreements">
<field name="name" filter_domain="['|', ('name', 'ilike', self), ('code', 'ilike', self)]" string="Name or Number"/>
<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/>
<filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
<group name="groupby">
@ -68,8 +68,8 @@
context="{'group_by': 'partner_id'}"/>
<filter name="signature_date_groupby" string="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>
</search>
</field>

2
agreement_sale/views/agreement.xml

@ -13,7 +13,7 @@
<field name="inherit_id" ref="agreement_account.agreement_form"/>
<field name="arch" type="xml">
<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"/>
</group>
</group>

4
agreement_sale/views/sale_order.xml

@ -14,8 +14,8 @@
<field name="arch" type="xml">
<field name="client_order_ref" position="after">
<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>
</record>

Loading…
Cancel
Save