Skip to content
Permalink
Browse files

[IMP] sale, account, purchase, repair: shorter labels

[REM] sale, web: remove advanced form
  • Loading branch information...
asa-odoo committed Mar 19, 2019
1 parent 4ce946c commit e2f913385492cacf114af3c1d2cfa8e20d8c1afa
@@ -336,9 +336,9 @@
context="{'default_partner_id': parent.partner_id}"/>
<field name="analytic_tag_ids" groups="analytic.group_analytic_tags" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="quantity"/>
<field name="uom_id" groups="uom.group_uom"/>
<field name="uom_id" string="UoM" groups="uom.group_uom"/>
<field name="price_unit"/>
<field name="discount" groups="base.group_no_one"/>
<field name="discount" string="Disc.%" groups="base.group_no_one"/>
<field name="invoice_line_tax_ids" widget="many2many_tags" options="{'no_create': True}" context="{'type':parent.type, 'tree_view_ref': 'account.account_tax_view_tree', 'search_view_ref': 'account.account_tax_view_search'}"
domain="[('type_tax_use','=','purchase'),('company_id', '=', parent.company_id)]"/>
<field name="price_subtotal" string="Amount"/>
@@ -511,9 +511,9 @@
context="{'default_partner_id': parent.partner_id}"/>
<field name="analytic_tag_ids" groups="analytic.group_analytic_tags" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="quantity"/>
<field name="uom_id" groups="uom.group_uom"/>
<field name="uom_id" string="UoM" groups="uom.group_uom"/>
<field name="price_unit" string="Price"/>
<field name="discount" groups="base.group_no_one" string="Disc (%)"/>
<field name="discount" groups="base.group_no_one" string="Disc.%"/>
<field name="invoice_line_tax_ids" widget="many2many_tags" options="{'no_create': True}" context="{'type':parent.type, 'tree_view_ref': 'account.account_tax_view_tree', 'search_view_ref': 'account.account_tax_view_search'}"
domain="[('type_tax_use','=','sale'),('company_id', '=', parent.company_id)]"/>
<field name="price_subtotal" string="Subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
@@ -57,7 +57,7 @@
<th class="text-right"><span>Quantity</span></th>
<th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Unit Price</span></th>
<th t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span>Disc.(%)</span>
<span>Disc.%</span>
<t t-set="colspan" t-value="colspan+1"/>
</th>
<th t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Taxes</span></th>
@@ -194,9 +194,9 @@
<field name="product_qty"/>
<field name="qty_received_manual" invisible="1"/>
<field name="qty_received_method" invisible="1"/>
<field name="qty_received" attrs="{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))], 'readonly': [('qty_received_method', '!=', 'manual')]}"/>
<field name="qty_invoiced" attrs="{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))]}"/>
<field name="product_uom" groups="uom.group_uom" attrs="{'readonly': [('state', 'in', ('purchase', 'done', 'cancel'))]}" force_save="1"/>
<field name="qty_received" string="Received" attrs="{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))], 'readonly': [('qty_received_method', '!=', 'manual')]}"/>
<field name="qty_invoiced" string="Billed" attrs="{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))]}"/>
<field name="product_uom" string="UoM" groups="uom.group_uom" attrs="{'readonly': [('state', 'in', ('purchase', 'done', 'cancel'))]}" force_save="1"/>
<field name="price_unit"/>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use','=','purchase')]" context="{'default_type_tax_use': 'purchase', 'search_view_ref': 'account.account_tax_view_search'}" options="{'no_create': True}"/>
<field name="price_subtotal" widget="monetary"/>
@@ -114,7 +114,7 @@
<field name="location_id" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations"/>
<field name="product_uom_qty" string="Quantity"/>
<field name="product_uom" string="Unit of Measure" groups="uom.group_uom"/>
<field name="product_uom" string="UoM" groups="uom.group_uom"/>
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale')]"/>
<field name="price_subtotal" widget="monetary"/>
@@ -64,24 +64,6 @@ def _get_combination_info_variant(self, add_qty=1, pricelist=False, parent_combi
self.ensure_one()
return self.product_tmpl_id._get_combination_info(self.product_template_attribute_value_ids, self.id, add_qty, pricelist, parent_combination)

@api.multi
def name_get(self):
if self._context.get('skip_description'):
return super(ProductProduct, self).name_get()
else:
result = [];
for product in self:
name = product.name
if product.default_code:
name = '[%s] %s' % (product.default_code, name)
if product.description_sale:
name += '\n' + product.description_sale
result.append((product.id, name))
return result

@api.model
def _name_search(self, name='', args=None, operator='ilike', limit=100, name_get_uid=None):
return super(ProductProduct, self)._name_search(name=name, args=args, operator=operator, limit=limit, name_get_uid=name_get_uid)

class ProductAttribute(models.Model):
_inherit = "product.attribute"
@@ -1112,7 +1112,7 @@ def write(self, values):

product_id = fields.Many2one('product.product', string='Product', domain=[('sale_ok', '=', True)], change_default=True, ondelete='restrict')
product_updatable = fields.Boolean(compute='_compute_product_updatable', string='Can Edit Product', readonly=True, default=True)
product_uom_qty = fields.Float(string='Ordered Quantity', digits=dp.get_precision('Product Unit of Measure'), required=True, default=1.0)
product_uom_qty = fields.Float(string='Quantity', digits=dp.get_precision('Product Unit of Measure'), required=True, default=1.0)
product_uom = fields.Many2one('uom.uom', string='Unit of Measure')
product_custom_attribute_value_ids = fields.One2many('product.attribute.custom.value', 'sale_order_line_id', string='User entered custom product attribute values')

@@ -1134,13 +1134,13 @@ def write(self, values):
" - Analytic From expenses: the quantity is the quantity sum from posted expenses\n"
" - Timesheet: the quantity is the sum of hours recorded on tasks linked to this sale line\n"
" - Stock Moves: the quantity comes from confirmed pickings\n")
qty_delivered = fields.Float('Delivered Quantity', copy=False, compute='_compute_qty_delivered', inverse='_inverse_qty_delivered', compute_sudo=True, store=True, digits=dp.get_precision('Product Unit of Measure'), default=0.0)
qty_delivered = fields.Float('Delivered', copy=False, compute='_compute_qty_delivered', inverse='_inverse_qty_delivered', compute_sudo=True, store=True, digits=dp.get_precision('Product Unit of Measure'), default=0.0)
qty_delivered_manual = fields.Float('Delivered Manually', copy=False, digits=dp.get_precision('Product Unit of Measure'), default=0.0)
qty_to_invoice = fields.Float(
compute='_get_to_invoice_qty', string='To Invoice Quantity', store=True, readonly=True,
digits=dp.get_precision('Product Unit of Measure'))
qty_invoiced = fields.Float(
compute='_get_invoice_qty', string='Invoiced Quantity', store=True, readonly=True,
compute='_get_invoice_qty', string='Invoiced', store=True, readonly=True,
digits=dp.get_precision('Product Unit of Measure'))

untaxed_amount_invoiced = fields.Monetary("Untaxed Invoiced Amount", compute='_compute_untaxed_amount_invoiced', compute_sudo=True, store=True)
@@ -75,7 +75,7 @@
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">
<span>Disc.(%)</span>
<span>Disc.%</span>
<t t-set="colspan" t-value="colspan+1"/>
</th>
<th class="text-right">Taxes</th>
@@ -429,7 +429,7 @@
<th class="text-right">Quantity</th>
<th t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">Unit Price</th>
<th t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<span>Discount</span>
<span>Disc.%</span>
<t t-set="colspan" t-value="colspan+1"/>
</th>
<th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">Taxes</th>
@@ -319,7 +319,7 @@
<field name="price_total" invisible="1"/>
<field name="price_tax" invisible="1"/>
<field name="price_subtotal" invisible="1"/>
<label for="product_uom_qty" string="Ordered Quantity"/>
<label for="product_uom_qty"/>
<div>
<field
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'uom_qty_change':True, 'company_id': parent.company_id}"
@@ -335,11 +335,11 @@
}"
/>
</div>
<label for="qty_delivered" string="Delivered Quantity" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
<label for="qty_delivered" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
<div attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}">
<field name="qty_delivered" attrs="{'readonly': [('qty_delivered_method', '!=', 'manual')]}"/>
</div>
<label for="qty_invoiced" string="Invoiced Quantity" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
<label for="qty_invoiced" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
<div attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}">
<field name="qty_invoiced" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
</div>
@@ -386,7 +386,6 @@
<tree
string="Sales Order Lines"
editable="bottom"
advanced_form="sale.sale_order_line_advanced_field_view_form"
decoration-info="(not display_type and invoice_status == 'to invoice')"
>
<control>
@@ -415,16 +414,14 @@
'uom':product_uom,
'company_id': parent.company_id,
'default_lst_price': price_unit,
'default_description_sale': name,
'skip_description': True
'default_description_sale': name
}"
/>
<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" invisible="1"/>
<field name="name" widget="section_and_note_text"/>
<field
name="product_uom_qty"
string="Ordered"
context="{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
@@ -435,7 +432,6 @@
/>
<field
name="qty_delivered"
string="Delivered"
attrs="{
'column_invisible': [('parent.state', 'not in', ['sale', 'done'])],
'readonly': [('qty_delivered_method', '!=', 'manual')]
@@ -445,14 +441,13 @@
<field name="qty_delivered_method" invisible="1"/>
<field
name="qty_invoiced"
string="Invoiced"
attrs="{'column_invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
/>
<field name="qty_to_invoice" invisible="1"/>
<field
name="product_uom"
force_save="1"
string="Unit"
string="UoM"
attrs="{
'readonly': [('state', 'in', ('sale','done', 'cancel'))],
'required': [('display_type', '=', False)],
@@ -465,11 +460,9 @@
name="analytic_tag_ids"
groups="analytic.group_analytic_tags"
widget="many2many_tags"
invisible="1"
/>
<field
name="price_unit"
string="Price"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"
/>
<field
@@ -479,12 +472,12 @@
domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"
/>
<field name="discount" string="Disc. %" groups="sale.group_discount_per_so_line" attrs="{'invisible':[('discount', '=', 0)]}"/>
<field name="discount" string="Disc.%" groups="sale.group_discount_per_so_line"/>
<field name="price_subtotal" widget="monetary" groups="account.group_show_line_subtotals_tax_excluded"/>
<field name="price_total" widget="monetary" groups="account.group_show_line_subtotals_tax_included"/>
<field name="state" invisible="1"/>
<field name="invoice_status" invisible="1"/>
<field name="customer_lead" invisible="1"/>
<field name="customer_lead" string="Lead Time" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="price_tax" invisible="1"/>
</tree>
@@ -608,27 +601,6 @@
</field>
</record>

<record id="sale_order_line_advanced_field_view_form" model="ir.ui.view">
<field name="name">sale.order.line.advanced.field.form</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<form string="Order Line Advanced Field">
<group>
<group>
<label for="customer_lead" string="Lead Time"/>
<div>
<field name="customer_lead" class="oe_inline"/> days
</div>
</group>
<group>
<field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags" options="{'color_field': 'color'}"/>
</group>
</group>
<field name="name"/>
</form>
</field>
</record>

<!-- inherited view to make the order lines list in the form non-editable
for the members of some usability groups -->
<record id="view_order_form_editable_list" model="ir.ui.view">
Oops, something went wrong.

0 comments on commit e2f9133

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