Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][ADD] mrp_subcontracting_purchase #1082

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mrp_subcontracting_purchase/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This bridge module adds some smart buttons between Purchase and Subcontracting

**DISCLAIMER:** This module is a backport from Odoo SA and as such, it is not included in the OCA CLA.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be put on readme/DESCRIPTION.rst, not here.


That means we do not have a copy of the copyright on it like all other OCA modules.
1 change: 1 addition & 0 deletions mrp_subcontracting_purchase/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
29 changes: 29 additions & 0 deletions mrp_subcontracting_purchase/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Purchase and Subcontracting Management",
"summary": """
This bridge module adds some smart buttons between Purchase and Subcontracting
""",
"website": "https://github.com/OCA/manufacture",
"version": "14.0.1.0.0",
"author": "Odoo S.A., Ooops, Cetmix, Odoo Community Association (OCA)",
"maintainers": ["dessanhemrayev", "CetmixGitDrone", "Volodiay622", "geomer198"],
"category": "Manufacturing/Purchase",
"depends": ["mrp_subcontracting", "purchase_mrp", "stock_dropshipping"],
"data": [
"data/mrp_subcontracting_dropshipping_data.xml",
"views/purchase_order_views.xml",
"views/stock_picking_views.xml",
],
"demo": [
"demo/product_category_demo.xml",
"demo/stock_location_demo.xml",
"demo/partner_subcontract_demo.xml",
"demo/product_product_demo.xml",
"demo/product_supplierinfo_demo.xml",
"demo/bom_subcontract_demo.xml",
"demo/stock_rules_demo.xml",
],
"installable": True,
"auto_install": True,
"license": "LGPL-3",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" ?>
<odoo>
<data noupdate="1">
<record id="route_subcontracting_dropshipping" model='stock.location.route'>
<field name="name">Dropship Subcontractor on Order</field>
<field name="sequence">5</field>
<field name="company_id" />
<field name="product_selectable" eval="True" />
</record>

<function
model="res.company"
name="create_missing_subcontracting_dropshipping_rules"
/>

<function model="stock.warehouse" name="write">
<value
model="stock.warehouse"
eval="obj().env['stock.warehouse'].search([]).ids"
/>
<value eval="{'subcontracting_dropshipping_to_resupply': True}" />
</function>
</data>
</odoo>
58 changes: 58 additions & 0 deletions mrp_subcontracting_purchase/demo/bom_subcontract_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<odoo noupdate="1">
<record id="mrp_bom_subcontract_1" model="mrp.bom">
<field
name="product_tmpl_id"
ref="demo_product_product_finished_product_template"
/>
<field name="product_uom_id" ref="uom.product_uom_unit" />
<field name="type">subcontract</field>
<field
name="subcontractor_ids"
eval="[(6, 0,[ref('res_partner_subcontracting_1')] )]"
/>
<field name="sequence">1</field>
</record>

<record id="mrp_bom_subcontract_2" model="mrp.bom">
<field
name="product_tmpl_id"
ref="demo_product_product_component_product_template"
/>
<field name="product_uom_id" ref="uom.product_uom_unit" />
<field name="type">subcontract</field>
<field
name="subcontractor_ids"
eval="[(6, 0,[ref('res_partner_subcontracting_2')] )]"
/>
<field name="sequence">1</field>
</record>

<record id="mrp_bom_subcontract_1_manufacture_line_1" model="mrp.bom.line">
<field
name="product_id"
ref="mrp_subcontracting_purchase.demo_product_product_component"
/>
<field name="product_qty">1</field>
<field name="product_uom_id" ref="uom.product_uom_unit" />
<field name="sequence">5</field>
<field
name="bom_id"
ref="mrp_subcontracting_purchase.mrp_bom_subcontract_1"
/>
</record>

<record id="mrp_bom_subcontract_2_manufacture_line_1" model="mrp.bom.line">
<field
name="product_id"
ref="mrp_subcontracting_purchase.demo_product_product_element"
/>
<field name="product_qty">1</field>
<field name="product_uom_id" ref="uom.product_uom_unit" />
<field name="sequence">5</field>
<field
name="bom_id"
ref="mrp_subcontracting_purchase.mrp_bom_subcontract_2"
/>
</record>

</odoo>
15 changes: 15 additions & 0 deletions mrp_subcontracting_purchase/demo/partner_subcontract_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<odoo>
<record id="res_partner_subcontracting_1" model="res.partner">
<field name="name">Sub 1</field>
<field name="property_stock_subcontractor" ref="demo_stock_location_sub_1" />
</record>

<record id="res_partner_subcontracting_2" model="res.partner">
<field name="name">Sub 2</field>
<field name="property_stock_subcontractor" ref="demo_stock_location_sub_2" />
</record>

<record id="res_partner_subcontracting_vendor" model="res.partner">
<field name="name">Vendor</field>
</record>
</odoo>
5 changes: 5 additions & 0 deletions mrp_subcontracting_purchase/demo/product_category_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<odoo>
<record id="product_category_subcontracting_product" model="product.category">
<field name="name">Subcontracting products</field>
</record>
</odoo>
40 changes: 40 additions & 0 deletions mrp_subcontracting_purchase/demo/product_product_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<odoo>
<record id="demo_product_product_finished" model="product.product">
<field name="name">Finished</field>
<field name="type">product</field>
<field name="list_price">10</field>
<field name="taxes_id" eval="False" />
<field name="sale_ok" eval="False" />
<field name="categ_id" ref="product_category_subcontracting_product" />
<field
name="route_ids"
eval="[(6, 0,[ref('purchase_stock.route_warehouse0_buy')])]"
/>
</record>

<record id="demo_product_product_component" model="product.product">
<field name="name">Component</field>
<field name="type">product</field>
<field name="list_price">10</field>
<field name="taxes_id" eval="False" />
<field name="sale_ok" eval="False" />
<field name="categ_id" ref="product_category_subcontracting_product" />
<field
name="route_ids"
eval="[(6, 0,[ref('route_subcontracting_dropshipping')])]"
/>
</record>

<record id="demo_product_product_element" model="product.product">
<field name="name">Element</field>
<field name="type">product</field>
<field name="list_price">10</field>
<field name="taxes_id" eval="False" />
<field name="sale_ok" eval="False" />
<field name="categ_id" ref="product_category_subcontracting_product" />
<field
name="route_ids"
eval="[(6, 0,[ref('route_subcontracting_dropshipping')])]"
/>
</record>
</odoo>
32 changes: 32 additions & 0 deletions mrp_subcontracting_purchase/demo/product_supplierinfo_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>
<record id="product_supplierinfo_subcontract_1" model="product.supplierinfo">
<field
name="product_tmpl_id"
ref="demo_product_product_finished_product_template"
/>
<field name="price">10</field>
<field name="name" ref="res_partner_subcontracting_1" />
<field name="currency_id" ref="base.USD" />
</record>

<record id="product_supplierinfo_subcontract_2" model="product.supplierinfo">
<field
name="product_tmpl_id"
ref="demo_product_product_component_product_template"
/>
<field name="price">10</field>
<field name="name" ref="res_partner_subcontracting_2" />
<field name="currency_id" ref="base.USD" />
</record>

<record id="product_supplierinfo_subcontract_3" model="product.supplierinfo">
<field
name="product_tmpl_id"
ref="demo_product_product_element_product_template"
/>
<field name="price">10</field>
<field name="name" ref="res_partner_subcontracting_vendor" />
<field name="currency_id" ref="base.USD" />
</record>
</odoo>
21 changes: 21 additions & 0 deletions mrp_subcontracting_purchase/demo/stock_location_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>
<record id="demo_stock_location_sub_1" model="stock.location">
<field name="name">sub1</field>
<field
name="location_id"
model="stock.location"
eval="obj().with_context(active_test=False).search([('name','=','Subcontracting Location'),('company_id','=',obj().env.company.id)],limit=1)"
/>
<field name="company_id" ref="base.main_company" />
</record>
<record id="demo_stock_location_sub_2" model="stock.location">
<field name="name">sub2</field>
<field
name="location_id"
model="stock.location"
eval="obj().with_context(active_test=False).search([('name','=','Subcontracting Location'),('company_id','=',obj().env.company.id)],limit=1)"
/>
<field name="company_id" ref="base.main_company" />
</record>
</odoo>
68 changes: 68 additions & 0 deletions mrp_subcontracting_purchase/demo/stock_rules_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>
<record id="demo_stock_rules_1" model="stock.rule">
<field name="name">Vendors — Sub 1</field>
<field name="action">buy</field>
<field name="location_id" ref="demo_stock_location_sub_1" />
<field name="route_id" ref="route_subcontracting_dropshipping" />
<field name="company_id" ref="base.main_company" />
<field
name="picking_type_id"
model="stock.picking.type"
eval="obj().with_context(active_test=False).search([('name','=','Dropship'),('sequence_code','=','DS'),('company_id','=',obj().env.company.id)],limit=1)"
/>
</record>

<record id="demo_stock_rules_2" model="stock.rule">
<field name="name">Vendors — Sub 2</field>
<field name="action">buy</field>
<field name="location_id" ref="demo_stock_location_sub_2" />
<field name="route_id" ref="route_subcontracting_dropshipping" />
<field name="company_id" ref="base.main_company" />
<field
name="picking_type_id"
model="stock.picking.type"
eval="obj().with_context(active_test=False).search([('name','=','Dropship'),('sequence_code','=','DS'),('company_id','=',obj().env.company.id)],limit=1)"
/>
</record>

<record id="demo_stock_rules_3" model="stock.rule">
<field name="name">Sub 1 — Production</field>
<field name="action">pull</field>
<field
name="picking_type_id"
model="stock.picking.type"
eval="obj().with_context(active_test=False).search([('name','=','Subcontracting'),('sequence_code','=','SBC')],limit=1)"
/>
<field name="location_src_id" ref="demo_stock_location_sub_1" />
<field
name="location_id"
model="stock.location"
eval="obj().search([('name','=','Production')],limit=1)"
/>
<field name="route_id" ref="route_subcontracting_dropshipping" />
<field name="warehouse_id" ref="stock.warehouse0" />
<field name="procure_method">make_to_order</field>
<field name="partner_address_id" ref="res_partner_subcontracting_1" />
</record>

<record id="demo_stock_rules_4" model="stock.rule">
<field name="name">Sub 2 — Production</field>
<field name="action">pull</field>
<field
name="picking_type_id"
model="stock.picking.type"
eval="obj().with_context(active_test=False).search([('name','=','Subcontracting'),('sequence_code','=','SBC')],limit=1)"
/>
<field name="location_src_id" ref="demo_stock_location_sub_2" />
<field
name="location_id"
model="stock.location"
eval="obj().search([('name','=','Production')],limit=1)"
/>
<field name="route_id" ref="route_subcontracting_dropshipping" />
<field name="warehouse_id" ref="stock.warehouse0" />
<field name="procure_method">make_to_order</field>
<field name="partner_address_id" ref="res_partner_subcontracting_2" />
</record>
</odoo>
Empty file.
10 changes: 10 additions & 0 deletions mrp_subcontracting_purchase/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import stock_move
from . import stock_warehouse
from . import stock_picking
from . import stock_rule
from . import purchase_order
from . import purchase_order_line
from . import res_company
from . import mrp_production
Loading
Loading