Browse Source

[IMP] add can shop boolean on the share product

It will avoid to test on hardcoded values. It also makes several shares
allowing to shop product from the coop
pull/134/head
houssine 4 years ago
committed by Rémy Taymans
parent
commit
ddda33015a
  1. 16
      beesdoo_easy_my_coop/__manifest__.py
  2. 1
      beesdoo_easy_my_coop/models/__init__.py
  3. 8
      beesdoo_easy_my_coop/models/product.py
  4. 13
      beesdoo_easy_my_coop/views/product.xml

16
beesdoo_easy_my_coop/__manifest__.py

@ -2,7 +2,8 @@
'name': "Beescoop link with easy my coop",
'summary': """
Module that made the link between beesdoo customization and easy_my_coop
Module that made the link between beesdoo customization
and easy_my_coop
""",
'description': """
@ -11,23 +12,22 @@
'author': "Beescoop - Cellule IT",
'website': "https://github.com/beescoop/Obeesdoo",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml
# for the full list
'category': 'Cooperative management',
'version': '12.0.1.0.0',
# any module necessary for this one to work correctly
'depends': ['beesdoo_base', 'beesdoo_shift', 'easy_my_coop', 'easy_my_coop_eater'],
'depends': ['beesdoo_base',
'beesdoo_shift',
'easy_my_coop',
'easy_my_coop_eater'
],
# always loaded
'data': [
'data/product_share.xml',
'views/partner.xml',
'views/res_company.xml',
'views/subscription_request.xml',
'views/subscription_templates.xml',
'views/product.xml'
],
'auto_install': True,
# only loaded in demonstration mode
}

1
beesdoo_easy_my_coop/models/__init__.py

@ -1,3 +1,4 @@
from . import res_partner
from . import subscription_request
from . import res_company
from . import product

8
beesdoo_easy_my_coop/models/product.py

@ -0,0 +1,8 @@
from odoo import models, fields
class ProductTemplate(models.Model):
inherit = 'product.template'
can_shop = fields.Boolean(string="Is share?")

13
beesdoo_easy_my_coop/views/product.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="product_template_share_form_view_beesdoo_emc" model="ir.ui.view">
<field name="name">product.template.share.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="easy_my_coop.product_template_share_form_view"/>
<field name="arch" type="xml">
<field name="customer" position="after">
<field name="can_shop"/>
</field>
</field>
</record>
</odoo>
Loading…
Cancel
Save