[FIX] Solve a bug
This commit is contained in:
parent
c86ecde62d
commit
a4c126743e
|
|
@ -110,7 +110,6 @@ class DonationsDetailsLines(models.Model):
|
|||
@api.depends('end_date', 'waiting_date')
|
||||
def _compute_period_display(self):
|
||||
today = date.today()
|
||||
print('Hiiiii')
|
||||
for rec in self:
|
||||
|
||||
# pick whichever date is set
|
||||
|
|
@ -120,11 +119,8 @@ class DonationsDetailsLines(models.Model):
|
|||
base_date = rec.waiting_date
|
||||
else:
|
||||
base_date = False
|
||||
print('Base >>> ' , base_date)
|
||||
if base_date:
|
||||
print('rec.waiting_date >>> ' , rec.waiting_date)
|
||||
delta = relativedelta(today, base_date)
|
||||
print('rec.delta >>> ' , str(delta))
|
||||
# build human-readable string
|
||||
if delta.years > 0:
|
||||
rec.period_display = f"{delta.years} year(s)"
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
<field name="name">donations.details.lines.view.tree</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree default_order="create_date asc , waiting_date asc , replace_date asc" create="0" edit="0" >
|
||||
<tree default_order="create_date asc , waiting_date asc " create="0" edit="0" >
|
||||
<field name="sponsorship_scheduling_line_ids" invisible="1" />
|
||||
<field name="direct_debit" invisible="1" />
|
||||
<field name="sequence_no" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue