Browse Source

[IMP] easy_my_coop_eater: black formatter

pull/84/head
Vincent Van Rossem 5 years ago
committed by robin.keunen
parent
commit
5dc5bd6b50
  1. 8
      easy_my_coop_eater/__manifest__.py
  2. 2
      easy_my_coop_eater/models/__init__.py
  3. 10
      easy_my_coop_eater/models/coop.py
  4. 9
      easy_my_coop_eater/models/product.py

8
easy_my_coop_eater/__manifest__.py

@ -23,12 +23,10 @@
"depends": ["easy_my_coop", "partner_age"],
"author": "Coop IT Easy SCRLfs",
"category": "Cooperative management",
'website': "www.coopiteasy.be",
"website": "www.coopiteasy.be",
"description": """
This module allows to manage the activity of the cooperator.
""",
'data': [
'view/product_view.xml',
],
'installable': True,
"data": ["view/product_view.xml"],
"installable": True,
}

2
easy_my_coop_eater/models/__init__.py

@ -1,2 +1,2 @@
from . import coop
from . import product
from . import product

10
easy_my_coop_eater/models/coop.py

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

9
easy_my_coop_eater/models/product.py

@ -2,8 +2,9 @@ from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
_inherit = "product.template"
eater = fields.Selection([('eater', 'Eater'),
('worker_eater', 'Worker and Eater')],
string="Eater/Worker")
eater = fields.Selection(
[("eater", "Eater"), ("worker_eater", "Worker and Eater")],
string="Eater/Worker",
)
Loading…
Cancel
Save