Browse Source

[IMP] move the flag become client to easy_my_coop_base

pull/1/head
houssine 7 years ago
parent
commit
f214882447
  1. 4
      easy_my_coop/models/coop.py
  2. 1
      easy_my_coop/models/product.py
  3. 1
      easy_my_coop/view/product_view.xml
  4. 1
      easy_my_coop_eater/models/coop.py
  5. 1
      easy_my_coop_eater/models/product.py
  6. 1
      easy_my_coop_eater/view/product_view.xml

4
easy_my_coop/models/coop.py

@ -234,7 +234,7 @@ class subscription_request(models.Model):
partner_vals = {'name':self.company_name, 'is_company': self.is_company, partner_vals = {'name':self.company_name, 'is_company': self.is_company,
'company_register_number':self.company_register_number, 'customer':False, 'company_register_number':self.company_register_number, 'customer':False,
'cooperator':True, 'street':self.address, 'zip':self.zip_code, 'cooperator':True, 'street':self.address, 'zip':self.zip_code,
'city': self.city,'email':self.email, 'out_inv_comm_type':'bba',
'city': self.city,'email':self.email, 'out_inv_comm_type':'bba','customer': share_product_id.customer,
'out_inv_comm_algorithm':'random', 'country_id': self.country_id.id, 'lang':self.lang} 'out_inv_comm_algorithm':'random', 'country_id': self.country_id.id, 'lang':self.lang}
return partner_vals return partner_vals
@ -244,7 +244,7 @@ class subscription_request(models.Model):
'city': self.city, 'phone': self.phone, 'email':self.email, 'city': self.city, 'phone': self.phone, 'email':self.email,
'national_register_number':self.no_registre, 'out_inv_comm_type':'bba', 'national_register_number':self.no_registre, 'out_inv_comm_type':'bba',
'out_inv_comm_algorithm':'random', 'country_id': self.country_id.id, 'out_inv_comm_algorithm':'random', 'country_id': self.country_id.id,
'lang':self.lang, 'birthdate':self.birthdate}
'lang':self.lang, 'birthdate':self.birthdate, 'customer': share_product_id.customer}
return partner_vals return partner_vals
def create_coop_partner(self): def create_coop_partner(self):

1
easy_my_coop/models/product.py

@ -12,6 +12,7 @@ class ProductTemplate(models.Model):
force_min_qty = fields.Boolean(String="Force minimum quantity?") force_min_qty = fields.Boolean(String="Force minimum quantity?")
by_company = fields.Boolean(string="Can be subscribed by companies?") by_company = fields.Boolean(string="Can be subscribed by companies?")
by_individual = fields.Boolean(string="Can be subscribed by individuals?") by_individual = fields.Boolean(string="Can be subscribed by individuals?")
customer = fields.Boolean(string='Become customer')
@api.multi @api.multi
def get_web_share_products(self, is_company): def get_web_share_products(self, is_company):

1
easy_my_coop/view/product_view.xml

@ -28,6 +28,7 @@
<field name="default_share_product" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/> <field name="default_share_product" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/>
<field name="force_min_qty" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/> <field name="force_min_qty" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/>
<field name="minimum_quantity" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/> <field name="minimum_quantity" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/>
<field name="customer" attrs="{'invisible':[('is_share','=',False)]}"/>
<field name="by_company" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/> <field name="by_company" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/>
<field name="by_individual" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/> <field name="by_individual" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_energiris_user"/>
</xpath> </xpath>

1
easy_my_coop_eater/models/coop.py

@ -12,7 +12,6 @@ class subscription_request(models.Model):
eater = 'eater' eater = 'eater'
vals['eater'] = eater vals['eater'] = eater
vals['customer'] = share_product_id.customer
return vals return vals

1
easy_my_coop_eater/models/product.py

@ -4,5 +4,4 @@ from openerp import api, fields, models, _
class ProductTemplate(models.Model): class ProductTemplate(models.Model):
_inherit = 'product.template' _inherit = 'product.template'
customer = fields.Boolean(string='Become customer')
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")

1
easy_my_coop_eater/view/product_view.xml

@ -6,7 +6,6 @@
<field name="inherit_id" ref="easy_my_coop.product_template_form_view"/> <field name="inherit_id" ref="easy_my_coop.product_template_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='minimum_quantity']" position="after"> <xpath expr="//field[@name='minimum_quantity']" position="after">
<field name="customer" attrs="{'invisible':[('is_share','=',False)]}"/>
<field name="eater" attrs="{'invisible':[('is_share','=',False)]}"/> <field name="eater" attrs="{'invisible':[('is_share','=',False)]}"/>
</xpath> </xpath>
</field> </field>

Loading…
Cancel
Save