Skip to content

Commit d9ad940

Browse files
[18.0][FIX] account_invoice_start_end_dates: Avoid same-label warning
Odoo's account_accountant has two fields with the same label on the same model. Avoid warning by renaming the fields in Python while keeping the same label in the views. account_accountant/models/account_move.py:446
1 parent b72923c commit d9ad940

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

account_invoice_start_end_dates/models/account_move_line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
class AccountMoveLine(models.Model):
1111
_inherit = "account.move.line"
1212

13-
start_date = fields.Date(index=True)
14-
end_date = fields.Date(index=True)
13+
start_date = fields.Date("Line Start Date", index=True)
14+
end_date = fields.Date("Line End Date", index=True)
1515
must_have_dates = fields.Boolean(related="product_id.must_have_dates")
1616

1717
@api.constrains(

account_invoice_start_end_dates/views/account_move_line.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
<field name="arch" type="xml">
1313
<field name="date_maturity" position="after">
1414
<field name="must_have_dates" invisible="1" />
15-
<field name="start_date" required="must_have_dates" />
16-
<field name="end_date" required="must_have_dates" />
15+
<field
16+
name="start_date"
17+
required="must_have_dates"
18+
string="Start Date"
19+
/>
20+
<field name="end_date" required="must_have_dates" string="End Date" />
1721
</field>
1822
</field>
1923
</record>
@@ -24,8 +28,8 @@
2428
<field name="arch" type="xml">
2529
<field name="date_maturity" position="after">
2630
<field name="must_have_dates" column_invisible="1" />
27-
<field name="start_date" optional="hide" />
28-
<field name="end_date" optional="hide" />
31+
<field name="start_date" optional="hide" string="Start Date" />
32+
<field name="end_date" optional="hide" string="End Date" />
2933
</field>
3034
</field>
3135
</record>

0 commit comments

Comments
 (0)