forked from Yaltik/golem
Prevent free activity from being invoiced
This commit is contained in:
parent
0c3a62cac8
commit
cbfccd5515
@ -36,7 +36,8 @@ class GolemMember(models.Model):
|
|||||||
regis = regis.filtered(
|
regis = regis.filtered(
|
||||||
lambda r: (r.state == 'confirmed' and
|
lambda r: (r.state == 'confirmed' and
|
||||||
(not r.invoice_line_id or
|
(not r.invoice_line_id or
|
||||||
r.invoice_line_id.invoice_id.state == 'cancel'))
|
r.invoice_line_id.invoice_id.state == 'cancel') and
|
||||||
|
not r.activity_id.free_activity)
|
||||||
)
|
)
|
||||||
member.has_invoicable_registrations = bool(len(regis))
|
member.has_invoicable_registrations = bool(len(regis))
|
||||||
|
|
||||||
@ -54,7 +55,8 @@ class GolemMember(models.Model):
|
|||||||
registrations = member.activity_registration_ids.filtered(
|
registrations = member.activity_registration_ids.filtered(
|
||||||
lambda r: r.state == 'confirmed' and
|
lambda r: r.state == 'confirmed' and
|
||||||
(not r.invoice_line_id or
|
(not r.invoice_line_id or
|
||||||
r.invoice_line_id.invoice_id.state == 'cancel')
|
r.invoice_line_id.invoice_id.state == 'cancel') and
|
||||||
|
not r.activity_id.free_activity
|
||||||
)
|
)
|
||||||
if registrations:
|
if registrations:
|
||||||
invoicing = self.env['golem.activity.registration.invoicing'].create({
|
invoicing = self.env['golem.activity.registration.invoicing'].create({
|
||||||
|
Loading…
Reference in New Issue
Block a user