Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by lreficent
- Loading branch information
Showing
12 changed files
with
271 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Antiun Ingenieria S.L. - Javier Iniesta | ||
# © 2016 Humanytek (http://humanytek.com/) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "MRP Sale Info", | ||
"summary": "Adds sale information to Manufacturing models", | ||
"version": "9.0.1.0.0", | ||
"version": "10.0.1.0.0", | ||
"category": "Manufacturing", | ||
"website": "http://www.antiun.com", | ||
"author": "Antiun Ingeniería S.L., " | ||
"OdooMRP team, " | ||
"AvanzOSC, " | ||
"Serv. Tecnol. Avanzados - Pedro M. Baeza, " | ||
"Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"application": False, | ||
'installable': False, | ||
'installable': True, | ||
"depends": [ | ||
"mrp_operations", | ||
"sale_mrp", | ||
"sale_order_dates", | ||
"stock" | ||
], | ||
"data": [ | ||
"views/mrp_production.xml", | ||
"views/mrp_production_workcenter_line.xml" | ||
"views/mrp_workorder.xml" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_sale_info | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 10.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-06-15 17:49+0000\n" | ||
"PO-Revision-Date: 2017-06-15 13:50-0400\n" | ||
"Last-Translator: Manuel Marquez <buzondemam@gmail.com>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: \n" | ||
"Language: es_MX\n" | ||
"X-Generator: Poedit 1.6.10\n" | ||
|
||
#. module: mrp_sale_info | ||
#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_commitment_date | ||
#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_commitment_date | ||
msgid "Commitment Date" | ||
msgstr "Fecha compromiso" | ||
|
||
#. module: mrp_sale_info | ||
#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_partner_id | ||
#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_partner_id | ||
#: model:ir.ui.view,arch_db:mrp_sale_info.mrp_production_sale_info_search_view | ||
#: model:ir.ui.view,arch_db:mrp_sale_info.view_mrp_workorder_form_view_filter | ||
msgid "Customer" | ||
msgstr "Cliente" | ||
|
||
#. module: mrp_sale_info | ||
#: model:ir.model.fields,help:mrp_sale_info.field_mrp_workorder_commitment_date | ||
msgid "" | ||
"Date by which the products are sure to be delivered. This is a date that you " | ||
"can promise to the customer, based on the Product Lead Times." | ||
msgstr "" | ||
"Fecha en la que se asegura que los productos estarán enviados. Esta es la " | ||
"fecha de compromiso con el cliente, basada en el tiempo de entrega." | ||
|
||
#. module: mrp_sale_info | ||
#: model:ir.model,name:mrp_sale_info.model_mrp_production | ||
msgid "Manufacturing Order" | ||
msgstr "Orden de Producción" | ||
|
||
#. module: mrp_sale_info | ||
#: model:ir.ui.view,arch_db:mrp_sale_info.mrp_workorder_sale_form_view_inherit | ||
msgid "Sale Information" | ||
msgstr "Información de Venta" | ||
|
||
#. module: mrp_sale_info | ||
#: model:ir.ui.view,arch_db:mrp_sale_info.mrp_production_sale_info_search_view | ||
#: model:ir.ui.view,arch_db:mrp_sale_info.view_mrp_workorder_form_view_filter | ||
msgid "Sale Order" | ||
msgstr "Pedido de Venta" | ||
|
||
#. module: mrp_sale_info | ||
#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_production_sale_id | ||
#: model:ir.model.fields,field_description:mrp_sale_info.field_mrp_workorder_sale_id | ||
msgid "Sale order" | ||
msgstr "Pedido de venta" | ||
|
||
#. module: mrp_sale_info | ||
#: model:ir.model,name:mrp_sale_info.model_mrp_workorder | ||
msgid "Work Order" | ||
msgstr "Orden de trabajo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- coding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from odoo import api, models | ||
|
||
|
||
class ProcurementOrder(models.Model): | ||
_inherit = 'procurement.order' | ||
|
||
@api.multi | ||
def make_mo(self): | ||
def get_parent_move(move): | ||
if move.move_dest_id: | ||
return get_parent_move(move.move_dest_id) | ||
return move | ||
|
||
res = super(ProcurementOrder, self).make_mo() | ||
for prod_id in res: | ||
production = self.env['mrp.production'].browse([res[prod_id]]) | ||
move = get_parent_move(production.move_finished_ids) | ||
proc = move.procurement_id | ||
|
||
production.sale_id = \ | ||
proc and proc.sale_line_id and \ | ||
proc.sale_line_id.order_id.id or False | ||
production.partner_id = \ | ||
production.sale_id and production.sale_id.partner_id and \ | ||
production.sale_id.partner_id.id or False | ||
production.commitment_date = \ | ||
production.sale_id and production.sale_id.commitment_date or '' | ||
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2017 Bima Jati Wijaya | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from . import test_sale_manufacture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2017 Bima Jati Wijaya | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests import TransactionCase | ||
|
||
|
||
class TestManufactureSale(TransactionCase): | ||
|
||
def setUp(self): | ||
super(TestManufactureSale, self).setUp() | ||
self.partner = self.env.ref('base.res_partner_1') | ||
self.mrp_production = self.env['mrp.production'] | ||
|
||
def test_manufacture(self): | ||
product = self.browse_ref('product.product_product_27') | ||
route1 = self.browse_ref('mrp.route_warehouse0_manufacture') | ||
route2 = self.browse_ref('stock.route_warehouse0_mto') | ||
# add make to order and manufacture routes | ||
product.write({'route_ids': [(6, 0, [route1.id, route2.id])]}) | ||
self.assertTrue(product.route_ids) | ||
|
||
so = self.env['sale.order'].create({ | ||
'partner_id': self.partner.id, | ||
'partner_invoice_id': self.partner.id, | ||
'partner_shipping_id': self.partner.id, | ||
'order_line': [(0, 0, {'name': product.name, | ||
'product_id': product.id, | ||
'product_uom_qty': 1, | ||
'product_uom': product.uom_id.id, | ||
'price_unit': product.list_price}) | ||
], | ||
'pricelist_id': self.env.ref('product.list0').id, | ||
}) | ||
so.action_confirm() | ||
mrp = self.mrp_production.search([('origin', 'like', so.name+'%')], | ||
limit=1) | ||
# checking sale info filled correctly on manufacture | ||
self.assertEqual(so.id, mrp.sale_id.id) | ||
self.assertEqual(self.partner.id, mrp.partner_id.id) | ||
self.assertEqual(so.commitment_date, mrp.commitment_date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,50 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
<odoo> | ||
<data> | ||
|
||
<record id="mrp_production_form_view" model="ir.ui.view"> | ||
<field name="name">MRP Production Form with Sale Order</field> | ||
<field name="model">mrp.production</field> | ||
<field name="inherit_id" ref="sale_mrp.mrp_production_form_view_inherit_sale_mrp" /> | ||
<field name="arch" type="xml"> | ||
<field name="sale_name" position="after"> | ||
<field name="sale_id"/> | ||
<field name="partner_id"/> | ||
<field name="commitment_date"/> | ||
<record id="mrp_production_form_view" model="ir.ui.view"> | ||
<field name="name">MRP Production Form with Sale Order</field> | ||
<field name="model">mrp.production</field> | ||
<field name="inherit_id" ref="mrp.mrp_production_form_view" /> | ||
<field name="arch" type="xml"> | ||
<field name="availability" position="after"> | ||
<field name="sale_id"/> | ||
<field name="partner_id"/> | ||
<field name="commitment_date"/> | ||
</field> | ||
</field> | ||
</field> | ||
</record> | ||
</record> | ||
|
||
<record id="mrp_production_tree_view" model="ir.ui.view"> | ||
<field name="name">MRP Production Tree with Sale Order</field> | ||
<field name="model">mrp.production</field> | ||
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/> | ||
<field name="arch" type="xml"> | ||
<field name="date_planned" position="after"> | ||
<field name="sale_id"/> | ||
<field name="partner_id"/> | ||
<field name="commitment_date"/> | ||
<record id="mrp_production_tree_view" model="ir.ui.view"> | ||
<field name="name">MRP Production Tree with Sale Order</field> | ||
<field name="model">mrp.production</field> | ||
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/> | ||
<field name="arch" type="xml"> | ||
<field name="date_planned_start" position="after"> | ||
<field name="sale_id"/> | ||
<field name="partner_id"/> | ||
<field name="commitment_date"/> | ||
</field> | ||
</field> | ||
</field> | ||
</record> | ||
</record> | ||
|
||
</data> | ||
</openerp> | ||
<record id="mrp_production_sale_info_search_view" model="ir.ui.view"> | ||
<field name="name">MRP Production search with Customer and Sale Order</field> | ||
<field name="model">mrp.production</field> | ||
<field name="inherit_id" ref="mrp.view_mrp_production_filter" /> | ||
<field name="arch" type="xml"> | ||
<field name="product_id" position="after"> | ||
<field name="partner_id" /> | ||
<field name="sale_id" /> | ||
</field> | ||
<group position="inside"> | ||
<filter string="Customer" icon="terp-accessories-archiver" | ||
domain="[]" context="{'group_by':'partner_id'}" /> | ||
<filter string="Sale Order" icon="terp-accessories-archiver" | ||
domain="[]" context="{'group_by':'sale_id'}" /> | ||
</group> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.