Browse Source

[PEP8] fix pep8 error

pull/1/head
houssine 6 years ago
parent
commit
ee4de91cc1
  1. 25
      easy_my_coop_eater/models/coop.py
  2. 9
      easy_my_coop_eater/models/product.py

25
easy_my_coop_eater/models/coop.py

@ -1,27 +1,28 @@
# -*- coding: utf-8 -*-
from openerp import api, fields, models
from openerp import api, models
class SubscriptionRequest(models.Model):
_inherit = 'subscription.request'
class subscription_request(models.Model):
_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'
vals['eater'] = eater
return vals
@api.one
def validate_subscription_request(self):
invoice = super(subscription_request, 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)
partner.write(vals)
return invoice
return invoice

9
easy_my_coop_eater/models/product.py

@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
from openerp import api, fields, models, _
from openerp import fields, models
class ProductTemplate(models.Model):
_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