Browse Source

[UPDT] Prouct approval update

pull/298/head
Ajmal Cybro 3 years ago
parent
commit
5c01a777ef
  1. 2
      product_approval_management/__manifest__.py
  2. 5
      product_approval_management/models/models.py
  3. 9
      product_approval_management/views/product_approval_views.xml

2
product_approval_management/__manifest__.py

@ -40,7 +40,7 @@
'views/product_approval_views.xml' 'views/product_approval_views.xml'
], ],
'images': ['static/description/banner.png'], 'images': ['static/description/banner.png'],
'version': '14.0.1.1.0', 'version': '14.0.2.2.0',
'license': 'LGPL-3', 'license': 'LGPL-3',
'installable': True, 'installable': True,
'auto_install': False, 'auto_install': False,

5
product_approval_management/models/models.py

@ -39,6 +39,11 @@ class ApproveProduct(models.Model):
for rec in self: for rec in self:
rec.approve_state = 'draft' rec.approve_state = 'draft'
def confirm_products(self):
active_ids = self.env.context.get('active_ids')
products = self.env['product.template'].browse(active_ids)
products.confirm_product_approval()
class SaleOrderLine(models.Model): class SaleOrderLine(models.Model):
_inherit = 'sale.order.line' _inherit = 'sale.order.line'

9
product_approval_management/views/product_approval_views.xml

@ -49,5 +49,14 @@
</field> </field>
</record> </record>
<record id="action_confirm_products" model="ir.actions.server">
<field name="name">Confirm</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="state">code</field>
<field name="code">model.confirm_products()</field>
<field name="binding_model_id" ref="product.model_product_template"/>
<field name="groups_id" eval="[(4, ref('product_approval_management.product_manager'))]"/>
</record>
</odoo> </odoo>

Loading…
Cancel
Save