[ADD] Add group on route on sales order line (took from sgo branch)

bzr revid: jco@openerp.com-20130916150908-c1yi104t3fbo8q37
This commit is contained in:
Josse Colpaert
2013-09-16 17:09:08 +02:00
parent acd22690a5
commit d3344c6667
7 changed files with 77 additions and 6 deletions
+1 -1
View File
@@ -246,7 +246,7 @@ class product_category(osv.osv):
_name = "product.category"
_description = "Product Category"
_columns = {
'name': fields.char('Name', size=64, required=True, translate=True, select=True),
'name': fields.char('Product Category Name', size=64, required=True, translate=True, select=True),
'complete_name': fields.function(_name_get_fnc, type="char", string='Name'),
'parent_id': fields.many2one('product.category','Parent Category', select=True, ondelete='cascade'),
'child_id': fields.one2many('product.category', 'parent_id', string='Child Categories'),
+1
View File
@@ -20,5 +20,6 @@
##############################################################################
import sale_stock_location
import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+3 -1
View File
@@ -36,7 +36,9 @@ This adds a route on the sales order and sales order line (mini module)
'images': [],
'depends': ['sale', 'stock_location'],
'init_xml': [],
'update_xml': ['sale_stock_location_view.xml'],
'update_xml': ['sale_stock_location_view.xml',
'security/sale_stock_location_security.xml',
'res_config_view.xml'],
'demo_xml': [],
'test': [],
'installable': True,
+35
View File
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import fields, osv
from openerp.tools.translate import _
class sale_configuration(osv.osv_memory):
_inherit = 'sale.config.settings'
_columns = {
'group_route_so_lines': fields.boolean('Choose MTO, Dropship, ... on sale order lines',
implied_group='sale_stock_location.group_route_so_lines',
help="Allows you to set route on sale order lines."),
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_sales_config_sale_stock_location" model="ir.ui.view">
<field name="name">sale stock location settings</field>
<field name="model">sale.config.settings</field>
<field name="inherit_id" ref="sale.view_sales_config"/>
<field name="arch" type="xml">
<data>
<xpath expr="//div[@name='Sale Features']" position="inside">
<div>
<field name="group_route_so_lines" class="oe_inline"/>
<label for="group_route_so_lines"/>
</div>
</xpath>
</data>
</field>
</record>
</data>
</openerp>
@@ -9,7 +9,7 @@
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='price_unit']" position="before">
<field name="route_id"/>
<field name="route_id" groups="sale_stock_location.group_route_so_lines"/>
</xpath>
</data>
</field>
@@ -21,7 +21,7 @@
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='price_subtotal']" position="before">
<field name="route_id"/>
<field name="route_id" groups="sale_stock_location.group_route_so_lines"/>
</xpath>
</field>
</record>
@@ -31,10 +31,10 @@
<field name="model">sale.order</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
<field name="route_id"/>
<field name="route_id" groups="sale_stock_location.group_route_so_lines"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="before">
<field name="route_id"/>
<field name="route_id" groups="sale_stock_location.group_route_so_lines"/>
</xpath>
</field>
</record>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="group_route_so_lines" model="res.groups">
<field name="name">Enable Route on Sales Order Line</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
</data>
</openerp>