Browse Source

[10.0] Added analytic tags to contracts

This commit adds ability to specify analytic tags on contracts invoice
lines, which will be propagated to invoice lines.
pull/110/head
Дмитро Катюха 7 years ago
committed by Дмитро Катюха
parent
commit
a8ef7c939d
  1. 2
      contract/__manifest__.py
  2. 2
      contract/models/account_analytic_account.py
  3. 4
      contract/models/account_analytic_invoice_line.py
  4. 1
      contract/views/account_analytic_account_view.xml
  5. 1
      contract/views/account_analytic_contract_view.xml

2
contract/__manifest__.py

@ -9,7 +9,7 @@
{ {
'name': 'Contracts Management - Recurring', 'name': 'Contracts Management - Recurring',
'version': '10.0.4.0.1',
'version': '10.0.4.1.1',
'category': 'Contract Management', 'category': 'Contract Management',
'license': 'AGPL-3', 'license': 'AGPL-3',
'author': "OpenERP SA, " 'author': "OpenERP SA, "

2
contract/models/account_analytic_account.py

@ -188,6 +188,8 @@ class AccountAnalyticAccount(models.Model):
'uom_id': line.uom_id.id, 'uom_id': line.uom_id.id,
'discount': line.discount, 'discount': line.discount,
}) })
# Add analytic tags to invoice line
invoice_line.analytic_tag_ids |= line.analytic_tag_ids
# Get other invoice line values from product onchange # Get other invoice line values from product onchange
invoice_line._onchange_product_id() invoice_line._onchange_product_id()
invoice_line_vals = invoice_line._convert_to_write(invoice_line._cache) invoice_line_vals = invoice_line._convert_to_write(invoice_line._cache)

4
contract/models/account_analytic_invoice_line.py

@ -65,6 +65,10 @@ class AccountAnalyticInvoiceLine(models.Model):
help='Discount that is applied in generated invoices.' help='Discount that is applied in generated invoices.'
' It should be less or equal to 100', ' It should be less or equal to 100',
) )
analytic_tag_ids = fields.Many2many(
'account.analytic.tag',
string='Analytic Tags',
)
sequence = fields.Integer( sequence = fields.Integer(
string="Sequence", string="Sequence",
default=10, default=10,

1
contract/views/account_analytic_account_view.xml

@ -82,6 +82,7 @@
<field name="specific_price" invisible="1"/> <field name="specific_price" invisible="1"/>
<field name="discount" groups="sale.group_discount_per_so_line" /> <field name="discount" groups="sale.group_discount_per_so_line" />
<field name="price_subtotal"/> <field name="price_subtotal"/>
<field name="analytic_tag_ids" widget="many2many_tags"/>
</tree> </tree>
</field> </field>
</div> </div>

1
contract/views/account_analytic_contract_view.xml

@ -41,6 +41,7 @@
<field name="specific_price" invisible="1"/> <field name="specific_price" invisible="1"/>
<field name="discount" groups="sale.group_discount_per_so_line" /> <field name="discount" groups="sale.group_discount_per_so_line" />
<field name="price_subtotal" /> <field name="price_subtotal" />
<field name="analytic_tag_ids" widget="many2many_tags" />
</tree> </tree>
</field> </field>
</group> </group>

Loading…
Cancel
Save