Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] sale_order_route: new module to load route in sale order lines …
…from the order
- Loading branch information
agaldona
committed
Apr 13, 2016
1 parent
5fe2bdc
commit 33f4aae
Showing
6 changed files
with
85 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
================ | ||
Sale Order Route | ||
================ | ||
|
||
This module adds new route_id field in sale order object. | ||
When the value of the field is changed, all routes from order lines will be filled with this value. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
* Ainara Galdona <ainaragaldona@avanzosc.es> | ||
* Ana Juaristi <anajuaristi@avanzosc.es> |
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,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2016 Ainara Galdona - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from . import models |
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,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2016 Ainara Galdona - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
{ | ||
"name": "Sale Order Route", | ||
"version": "8.0.1.0.0", | ||
'author': 'OdooMRP team', | ||
'website': "http://www.odoomrp.com", | ||
'contributors': ["Ainara Galdona <ainaragaldona@avanzosc.es>", | ||
"Ana Juaristi <anajuaristi@avanzosc.es>"], | ||
"depends": [ | ||
'sale_stock', | ||
], | ||
"category": "Sales Management", | ||
"data": ['views/sale_order_view.xml'], | ||
"installable": True | ||
} |
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,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2016 Ainara Galdona - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from . import sale_order |
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,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2016 Ainara Galdona - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from openerp import models, fields, api | ||
|
||
|
||
class SaleOrder(models.Model): | ||
|
||
_inherit = 'sale.order' | ||
|
||
route_id = fields.Many2one(comodel_name='stock.location.route', | ||
string='Route', | ||
domain=[('sale_selectable', '=', True)]) | ||
|
||
@api.multi | ||
@api.onchange('route_id') | ||
def onchange_route_id(self): | ||
self.ensure_one() | ||
for line in self.order_line: | ||
line.route_id = self.route_id |
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,18 @@ | ||
<?xml version="1.0"?> | ||
<openerp> | ||
<data> | ||
<record model="ir.ui.view" id="view_order_form"> | ||
<field name="name">sale.order.route.form</field> | ||
<field name="model">sale.order</field> | ||
<field name="inherit_id" ref="sale_stock.view_order_form_inherit" /> | ||
<field name="arch" type="xml"> | ||
<field name="warehouse_id" position="after"> | ||
<field name="route_id" groups="sale_stock.group_route_so_lines"/> | ||
</field> | ||
<field name="order_line" position="attributes"> | ||
<attribute name="context">{'default_route_id': route_id}</attribute> | ||
</field> | ||
</field> | ||
</record> | ||
</data> | ||
</openerp> |