Browse Source

[FIX] name_on_contract requirement

pull/235/head
tarteo 6 years ago
parent
commit
314365d700
  1. 8
      contract/migrations/11.0.4.0.1/post-migration.py
  2. 1
      contract/models/account_analytic_contract_line.py
  3. 2
      contract/report/report_contract.xml
  4. 2
      contract/views/account_analytic_account_view.xml
  5. 2
      contract/views/account_analytic_contract_view.xml

8
contract/migrations/11.0.4.0.1/post-migration.py

@ -1,8 +0,0 @@
# Copyright 2018 Onestein
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def migrate(cr, version):
"""Copy the name to name_on_contract."""
cr.execute("""UPDATE account_analytic_contract_line
SET name_on_contract = name""")

1
contract/models/account_analytic_contract_line.py

@ -35,7 +35,6 @@ class AccountAnalyticContractLine(models.Model):
)
name_on_contract = fields.Text(
string='Description (on contract)',
required=True,
)
quantity = fields.Float(
default=1.0,

2
contract/report/report_contract.xml

@ -56,7 +56,7 @@
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right">
<span t-esc="recurring_invoice_total" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
<span t-esc="o.recurring_invoice_total" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>

2
contract/views/account_analytic_account_view.xml

@ -79,7 +79,7 @@
<field name="sequence" widget="handle" />
<field name="product_id"/>
<field name="name"/>
<field name="name_on_contract" />
<field name="name_on_contract" required="1" />
<field name="quantity"/>
<field name="uom_id"/>
<field name="automatic_price"/>

2
contract/views/account_analytic_contract_view.xml

@ -37,7 +37,7 @@
<field name="sequence" widget="handle" />
<field name="product_id" />
<field name="name" />
<field name="name_on_contract" />
<field name="name_on_contract" required="1" />
<field name="quantity" />
<field name="uom_id" />
<field name="automatic_price" attrs="{'column_invisible': [('parent.contract_type','=','purchase')]}"/>

Loading…
Cancel
Save