Skip to content
Permalink
Browse files

[IMP] Account, purchase, sale, repair : Make order line structure con…

…sistent.

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

Task-1912608

Change rapair view for parts
  • Loading branch information...
jar-odoo committed Dec 11, 2018
1 parent 39e7135 commit 31fb1e7d45c98e1c1ead4c8788a42963ee6eb576
@@ -91,18 +91,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>
@@ -432,7 +432,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_type = fields.Selection(related='product_id.type', readonly=True)
price_unit = fields.Float(string='Unit Price', required=True, digits=dp.get_precision('Product Price'))
@@ -213,13 +213,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'}"/>
@@ -75,36 +75,31 @@
<page string="Parts">
<field name="operations" context="{'default_product_uom_qty': product_qty}">
<form string="Operations">
<notebook>
<page string="Repair Line">
<group>
<group>
<field name="product_id"/>
<field name="name"/>
<label for="product_uom_qty"/>
<div class="o_row">
<field name="product_uom_qty"/>
<field name="product_uom" groups="uom.group_uom"/>
</div>
<field name="type" invisible="1"/>
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale')]"/>
<field name="invoiced" invisible="1"/>
<field name="price_subtotal" widget="monetary" invisible="1"/>
</group>
<group groups="stock.group_stock_multi_locations">
<field name="location_id" />
<field name="location_dest_id"/>
</group>
</group>
</page>
<page string="History" attrs="{'invisible':[('move_id','=', False)]}">
<group>
<field name="move_id" />
<field name="invoice_line_id" invisible="1"/>
</group>
</page>
</notebook>
<group>
<group>
<field name="product_id"/>
<field name="name"/>
<label for="product_uom_qty"/>
<div class="o_row">
<field name="product_uom_qty"/>
<field name="product_uom" groups="uom.group_uom"/>
</div>
<field name="type" invisible="1"/>
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale')]"/>
<field name="invoiced" invisible="1"/>
<field name="price_subtotal" widget="monetary" invisible="1"/>
</group>
<group>
<field name="lot_id" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}" groups="stock.group_production_lot"/>
<field name="location_id" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations"/>
</group>
</group>
<group name="History" string="History">
<field name="move_id" attrs="{'invisible':[('move_id','=', False)]}"/>
<field name="invoice_line_id" invisible="1"/>
</group>
</form>
<tree string="Operations" editable="bottom">
<field name="type"/>
@@ -328,7 +328,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)],
@@ -344,6 +344,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"/> %%
@@ -357,8 +359,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
@@ -420,6 +420,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"
@@ -456,11 +461,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 31fb1e7

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