Browse Source

Jan 17: [FIX] Bug Fixed 'mrp_order_from_multiple_sale_order'

pull/309/head
Cybrosys Technologies 3 months ago
parent
commit
f6d229d977
  1. 2
      mrp_order_from_multiple_sale_order/README.rst
  2. 4
      mrp_order_from_multiple_sale_order/__manifest__.py
  3. 20
      mrp_order_from_multiple_sale_order/data/ir_actions_server_data.xml
  4. 4
      mrp_order_from_multiple_sale_order/doc/RELEASE_NOTES.md
  5. 10
      mrp_order_from_multiple_sale_order/models/sale_order.py
  6. 4
      mrp_order_from_multiple_sale_order/static/description/index.html
  7. 4
      mrp_order_from_multiple_sale_order/views/sale_order_views.xml

2
mrp_order_from_multiple_sale_order/README.rst

@ -2,7 +2,7 @@
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
MRP Order from Multiple Sale Order MRP ORDER FROM MULTIPLE SALE ORDER
================================== ==================================
This module allows users to Create MRP order by selecting multiple sale orders in the sales module. This module allows users to Create MRP order by selecting multiple sale orders in the sales module.

4
mrp_order_from_multiple_sale_order/__manifest__.py

@ -20,8 +20,8 @@
# #
############################################################################### ###############################################################################
{ {
'name': "MRP Order from Multiple Sale Order", 'name': "MRP ORDER FROM MULTIPLE SALE ORDER",
'version': '17.0.1.0.0', 'version': '17.0.1.0.1',
'category': 'Sales', 'category': 'Sales',
'summary': """Create MRP Order by choosing multiple Sale Order.""", 'summary': """Create MRP Order by choosing multiple Sale Order.""",
'description': 'This module allows users to Create MRP order by selecting ' 'description': 'This module allows users to Create MRP order by selecting '

20
mrp_order_from_multiple_sale_order/data/ir_actions_server_data.xml

@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<data> <record id="action_mrp_order" model="ir.actions.server">
<record id="action_mrp_order" model="ir.actions.server"> <!--Add a button within the action on the sale order list view-->
<!--Add a button within the action on the sale order list view--> <field name="name">Create MRP Order</field>
<field name="name">Create MRP Order</field> <field name="model_id" ref="sale.model_sale_order"/>
<field name="model_id" ref="sale.model_sale_order"/> <field name="binding_model_id" ref="sale.model_sale_order"/>
<field name="binding_model_id" ref="sale.model_sale_order"/> <field name="binding_view_types">list</field>
<field name="binding_view_types">list</field> <field name="state">code</field>
<field name="state">code</field> <field name="code">action = records.action_mrp_order()</field>
<field name="code">action = records.action_mrp_order()</field> </record>
</record>
</data>
</odoo> </odoo>

4
mrp_order_from_multiple_sale_order/doc/RELEASE_NOTES.md

@ -1,6 +1,6 @@
## Module <mrp_order_from_multiple_sale_order> ## Module <mrp_order_from_multiple_sale_order>
#### 10.09.2024 #### 21.08.2024
#### Version 17.0.1.0.0 #### Version 17.0.1.0.0
#### ADD #### ADD
- Initial commit for MRP Order from Multiple Sale Order - Initial commit for MRP ORDER FROM MULTIPLE SALE ORDER

10
mrp_order_from_multiple_sale_order/models/sale_order.py

@ -31,9 +31,9 @@ class SaleOrder(models.Model):
mrp_count = fields.Integer(compute='_compute_mrp_count', mrp_count = fields.Integer(compute='_compute_mrp_count',
string="MRP Count", string="MRP Count",
help="Get total count of mrp order") help="Get total count of mrp order")
mrp_production_ids = fields.Many2many("mrp.production", mrp_order_ids = fields.Many2many("mrp.production",
string="MRP Orders", string="MRP Orders",
help="Get MRP order in sale order") help="Get MRP order in sale order")
def _compute_mrp_count(self): def _compute_mrp_count(self):
"""Compute function for getting total count of manufacturing order """Compute function for getting total count of manufacturing order
@ -46,7 +46,7 @@ class SaleOrder(models.Model):
"""Button action for generating Manufacturing Orders while """Button action for generating Manufacturing Orders while
selecting Sale Orders.""" selecting Sale Orders."""
for order in self: for order in self:
if order.mrp_production_ids: if order.mrp_order_ids:
raise ValidationError( raise ValidationError(
"The sale order has already a manufacturing order.!") "The sale order has already a manufacturing order.!")
if order.state == "draft": if order.state == "draft":
@ -57,7 +57,7 @@ class SaleOrder(models.Model):
'product_id': line.product_id.id, 'product_id': line.product_id.id,
'sale_order_id': order.id, 'sale_order_id': order.id,
}) })
order.mrp_production_ids = self.env['mrp.production'].search( order.mrp_order_ids = self.env['mrp.production'].search(
[('sale_order_id', '=', order.id)]) [('sale_order_id', '=', order.id)])
else: else:
raise ValidationError("Choose the draft sale order.!") raise ValidationError("Choose the draft sale order.!")

4
mrp_order_from_multiple_sale_order/static/description/index.html

@ -4,7 +4,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MRP Order from Multiple Sale Order</title> <title>MRP ORDER FROM MULTIPLE SALE ORDER</title>
<!-- Bootstrap CSS --> <!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
@ -224,7 +224,7 @@
style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);"> style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="d-flex mb-3" style="font-size: 0.8rem; font-weight: 500;"><span>Version <div class="d-flex mb-3" style="font-size: 0.8rem; font-weight: 500;"><span>Version
17.0.1.0.0</span><span class="px-2">|</span><span 17.0.1.0.0</span><span class="px-2">|</span><span
style="color: #714B67;font-weight: 600;">Released on:10 Sep 2024</span> style="color: #714B67;font-weight: 600;">Released on:21 Aug 2024</span>
</div> </div>
<p class="m-0" <p class="m-0"
style=" color:#718096!important; font-size:1rem !important;line-height: 28px;"> style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">

4
mrp_order_from_multiple_sale_order/views/sale_order_views.xml

@ -29,7 +29,7 @@
Sale Order tree view for displays MRP Orders.--> Sale Order tree view for displays MRP Orders.-->
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='team_id']" position="after"> <xpath expr="//field[@name='team_id']" position="after">
<field name="mrp_production_ids" widget="many2many_tags"/> <field name="mrp_order_ids" widget="many2many_tags"/>
</xpath> </xpath>
</field> </field>
</record> </record>
@ -43,7 +43,7 @@
Quotation tree view for displays MRP Orders.--> Quotation tree view for displays MRP Orders.-->
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='tag_ids']" position="after"> <xpath expr="//field[@name='tag_ids']" position="after">
<field name="mrp_production_ids" widget="many2many_tags"/> <field name="mrp_order_ids" widget="many2many_tags"/>
</xpath> </xpath>
</field> </field>
</record> </record>

Loading…
Cancel
Save