Skip to content
Permalink
Browse files

[IMP] Account, purchase, sale : Make order line structure consistent.

Sales order line, Purchase order line and invoice line tree view and form view are not unified.
so make consistent view for all three object.

Task-1912608
  • Loading branch information...
jar-odoo committed Dec 11, 2018
1 parent e67b229 commit 6f27ff2f3e9f20677cbcdf89a6d6f4c409d17264
@@ -89,18 +89,17 @@
<label for="quantity"/>
<div>
<field name="quantity" class="oe_inline"/>
<field name="uom_id" class="oe_inline" groups="uom.group_uom"/>
<field name="uom_id" class="oe_inline ml-2" groups="uom.group_uom"/>
</div>
<field name="price_unit"/>
<field name="discount" groups="base.group_no_one"/>
<field name="invoice_line_tax_ids" context="{'type': invoice_type}" domain="[('type_tax_use','!=','none'),('company_id', '=', company_id)]" widget="many2many_tags" options="{'no_create': True}"/>
<field name="currency_id" invisible="1"/>
</group>
<group>
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field domain="[('company_id', '=', company_id)]" name="account_id" groups="account.group_account_user"/>
<field name="invoice_line_tax_ids" context="{'type': invoice_type}" domain="[('type_tax_use','!=','none'),('company_id', '=', company_id)]" widget="many2many_tags" options="{'no_create': True}"/>
<field domain="[('company_id', '=', company_id)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
<field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags"/>
<field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags" options="{'color_field': 'color'}"/>
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
</group>
</group>
@@ -422,7 +422,7 @@ class PurchaseOrderLine(models.Model):
product_uom_qty = fields.Float(string='Total Quantity', compute='_compute_product_uom_qty', store=True)
date_planned = fields.Datetime(string='Scheduled Date', required=True, index=True)
taxes_id = fields.Many2many('account.tax', string='Taxes', domain=['|', ('active', '=', False), ('active', '=', True)])
product_uom = fields.Many2one('uom.uom', string='Product Unit of Measure', required=True)
product_uom = fields.Many2one('uom.uom', string='Unit of Measure', required=True)
product_id = fields.Many2one('product.product', string='Product', domain=[('purchase_ok', '=', True)], change_default=True, required=True)
product_image = fields.Binary(
'Product Image', related="product_id.image", readonly=False,
@@ -211,13 +211,15 @@
<label for="product_qty"/>
<div>
<field name="product_qty" class="oe_inline"/>
<span class="oe_inline">&#160;</span>
<field name="product_uom" groups="uom.group_uom" class="oe_inline"/>
<field name="product_uom" groups="uom.group_uom" class="oe_inline ml-2"/>
</div>
<field name="qty_received_method" invisible="1"/>
<field name="qty_received" attrs="{'invisible': [('parent.state', 'not in', ('purchase', 'done'))], 'readonly': [('qty_received_method', '!=', 'manual')]}"/>
<field name="qty_invoiced" attrs="{'invisible': [('parent.state', 'not in', ('purchase', 'done'))]}"/>
<field name="price_unit"/>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use', '=', 'purchase')]" options="{'no_create': True}"/>
</group>
<group>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use', '=', 'purchase')]" options="{'no_create': True}"/>
<field name="date_planned" widget="date"/>
<field name="account_analytic_id" colspan="2" groups="analytic.group_analytic_accounting"/>
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags" options="{'color_field': 'color'}"/>
@@ -325,7 +325,7 @@
name="product_uom"
force_save="1"
groups="uom.group_uom"
class="oe_inline oe_no_button"
class="oe_inline oe_no_button ml-2"
attrs="{
'readonly': [('state', 'in', ('sale', 'done', 'cancel'))],
'required': [('display_type', '=', False)],
@@ -341,6 +341,8 @@
<field name="qty_invoiced" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
</div>
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" options="{'no_create': True}" context="{'search_view_ref': 'account.account_tax_view_search'}" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"/>
<label for="discount" groups="sale.group_discount_per_so_line"/>
<div name="discount" groups="sale.group_discount_per_so_line">
<field name="discount" class="oe_inline"/> %%
@@ -354,8 +356,6 @@
<field name="sequence" invisible="1"/>
</group>
<group attrs="{'invisible': [('display_type', '!=', False)]}">
<field name="tax_id" widget="many2many_tags" options="{'no_create': True}" context="{'search_view_ref': 'account.account_tax_view_search'}" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"/>
<label for="customer_lead"/>
<div>
<field name="customer_lead" class="oe_inline"/> days
@@ -417,6 +417,11 @@
<field name="product_custom_attribute_value_ids" invisible="1" />
<field name="product_no_variant_attribute_value_ids" invisible="1" />
<field name="name" widget="section_and_note_text"/>
<field
name="analytic_tag_ids"
groups="analytic.group_analytic_tags"
widget="many2many_tags"
/>
<field
name="product_uom_qty"
string="Ordered Qty"
@@ -453,11 +458,6 @@
groups="uom.group_uom"
options='{"no_open": True}'
/>
<field
name="analytic_tag_ids"
groups="analytic.group_analytic_tags"
widget="many2many_tags"
/>
<field
name="price_unit"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"
@@ -27,13 +27,13 @@
<xpath expr="//field[@name='commitment_date']" position="after">
<field name="effective_date" groups="sale.group_sale_order_dates"/>
</xpath>
<xpath expr="//page/field[@name='order_line']/form/group/group/field[@name='tax_id']" position="before">
<xpath expr="//page/field[@name='order_line']/form/group/group/label[@for='customer_lead']" position="before">
<field name="product_packaging" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" domain="[('product_id','=',product_id)]" groups="product.group_stock_packaging" />
</xpath>
<xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
<xpath expr="//field[@name='order_line']/form/group/group/label[@for='analytic_tag_ids']" position="before">
<field name="route_id" groups="sale_stock.group_route_so_lines" options="{'no_create': True}"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="before">
<xpath expr="//field[@name='order_line']/tree/field[@name='analytic_tag_ids']" position="after">
<field name="route_id" groups="sale_stock.group_route_so_lines" options="{'no_create': True}"/>
</xpath>
</field>

0 comments on commit 6f27ff2

Please sign in to comment.
You can’t perform that action at this time.