[IMP] add section and note functionality
This commit is contained in:
@@ -57,6 +57,7 @@ class AccountInvoiceUpdate(models.TransientModel):
|
|||||||
'price_subtotal': line.price_subtotal,
|
'price_subtotal': line.price_subtotal,
|
||||||
'account_analytic_id': line.account_analytic_id.id,
|
'account_analytic_id': line.account_analytic_id.id,
|
||||||
'analytic_tag_ids': aa_tags,
|
'analytic_tag_ids': aa_tags,
|
||||||
|
'display_type': line.display_type,
|
||||||
}])
|
}])
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@@ -287,6 +288,9 @@ class AccountInvoiceLineUpdate(models.TransientModel):
|
|||||||
invoice_line_id = fields.Many2one(
|
invoice_line_id = fields.Many2one(
|
||||||
'account.invoice.line', string='Invoice Line', readonly=True)
|
'account.invoice.line', string='Invoice Line', readonly=True)
|
||||||
name = fields.Text(string='Description', required=True)
|
name = fields.Text(string='Description', required=True)
|
||||||
|
display_type = fields.Selection([
|
||||||
|
('line_section', "Section"),
|
||||||
|
('line_note', "Note")], default=False, help="Technical field for UX purpose.")
|
||||||
quantity = fields.Float(
|
quantity = fields.Float(
|
||||||
string='Quantity', digits=dp.get_precision('Product Unit of Measure'),
|
string='Quantity', digits=dp.get_precision('Product Unit of Measure'),
|
||||||
readonly=True)
|
readonly=True)
|
||||||
|
|||||||
@@ -25,13 +25,14 @@
|
|||||||
</group>
|
</group>
|
||||||
<group name="lines">
|
<group name="lines">
|
||||||
<field name="line_ids" nolabel="1">
|
<field name="line_ids" nolabel="1">
|
||||||
<tree editable="bottom">
|
<tree editable="bottom" create="false" delete="false" edit="true">
|
||||||
<field name="invoice_line_id" invisible="1"/>
|
<field name="invoice_line_id" invisible="1"/>
|
||||||
|
<field name="display_type" invisible="1"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="quantity"/>
|
<field name="quantity" attrs="{'invisible': [('display_type', '!=', False)]}"/>
|
||||||
<field name="price_subtotal"/>
|
<field name="price_subtotal" attrs="{'invisible': [('display_type', '!=', False)]}"/>
|
||||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
<field name="account_analytic_id" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_accounting"/>
|
||||||
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags"/>
|
<field name="analytic_tag_ids" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_accounting" widget="many2many_tags"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
Reference in New Issue
Block a user