|
@ -2,23 +2,25 @@ from odoo import api, models |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SubscriptionRequest(models.Model): |
|
|
class SubscriptionRequest(models.Model): |
|
|
_inherit = 'subscription.request' |
|
|
|
|
|
|
|
|
_inherit = "subscription.request" |
|
|
|
|
|
|
|
|
def get_eater_vals(self, partner, share_product_id): |
|
|
def get_eater_vals(self, partner, share_product_id): |
|
|
vals = {} |
|
|
vals = {} |
|
|
eater = share_product_id.eater |
|
|
eater = share_product_id.eater |
|
|
|
|
|
|
|
|
if partner.is_company or partner.age < 18: |
|
|
if partner.is_company or partner.age < 18: |
|
|
eater = 'eater' |
|
|
|
|
|
|
|
|
eater = "eater" |
|
|
|
|
|
|
|
|
vals['eater'] = eater |
|
|
|
|
|
|
|
|
vals["eater"] = eater |
|
|
|
|
|
|
|
|
return vals |
|
|
return vals |
|
|
|
|
|
|
|
|
@api.one |
|
|
@api.one |
|
|
def validate_subscription_request(self): |
|
|
def validate_subscription_request(self): |
|
|
|
|
|
|
|
|
invoice = super(SubscriptionRequest, self).validate_subscription_request()[0] |
|
|
|
|
|
|
|
|
invoice = super( |
|
|
|
|
|
SubscriptionRequest, self |
|
|
|
|
|
).validate_subscription_request()[0] |
|
|
partner = invoice.partner_id |
|
|
partner = invoice.partner_id |
|
|
|
|
|
|
|
|
vals = self.get_eater_vals(partner, self.share_product_id) |
|
|
vals = self.get_eater_vals(partner, self.share_product_id) |
|
|