Browse Source

[IMP] contract: Add display sequence on contract lines (#119)

13.0-mig-contract
Pedro Castro Silva 7 years ago
committed by Administrator
parent
commit
8e5f381877
  1. 2
      contract/__manifest__.py
  2. 6
      contract/models/account_analytic_invoice_line.py
  3. 1
      contract/views/account_analytic_account_view.xml
  4. 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.3.0.0',
'version': '10.0.3.1.0',
'category': 'Contract Management', 'category': 'Contract Management',
'license': 'AGPL-3', 'license': 'AGPL-3',
'author': "OpenERP SA, " 'author': "OpenERP SA, "

6
contract/models/account_analytic_invoice_line.py

@ -14,6 +14,7 @@ from odoo.tools.translate import _
class AccountAnalyticInvoiceLine(models.Model): class AccountAnalyticInvoiceLine(models.Model):
_name = 'account.analytic.invoice.line' _name = 'account.analytic.invoice.line'
_order = "sequence,id"
product_id = fields.Many2one( product_id = fields.Many2one(
'product.product', 'product.product',
@ -54,6 +55,11 @@ 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',
) )
sequence = fields.Integer(
string="Sequence",
default=10,
help="Sequence of the contract line when displaying contracts",
)
@api.multi @api.multi
@api.depends('quantity', 'price_unit', 'discount') @api.depends('quantity', 'price_unit', 'discount')

1
contract/views/account_analytic_account_view.xml

@ -60,6 +60,7 @@
<div attrs="{'invisible': [('recurring_invoices','=',False)]}"> <div attrs="{'invisible': [('recurring_invoices','=',False)]}">
<field name="recurring_invoice_line_ids"> <field name="recurring_invoice_line_ids">
<tree string="Account Analytic Lines" editable="bottom"> <tree string="Account Analytic Lines" editable="bottom">
<field name="sequence" widget="handle" />
<field name="product_id"/> <field name="product_id"/>
<field name="name"/> <field name="name"/>
<field name="quantity"/> <field name="quantity"/>

1
contract/views/account_analytic_contract_view.xml

@ -30,6 +30,7 @@
<group name="group_invoice_lines" string="Invoice Lines"> <group name="group_invoice_lines" string="Invoice Lines">
<field name="recurring_invoice_line_ids"> <field name="recurring_invoice_line_ids">
<tree string="Account Analytic Lines" editable="bottom"> <tree string="Account Analytic Lines" editable="bottom">
<field name="sequence" widget="handle" />
<field name="product_id" /> <field name="product_id" />
<field name="name" /> <field name="name" />
<field name="quantity" /> <field name="quantity" />

Loading…
Cancel
Save