openerp-community-reviewer team mailing list archive
-
openerp-community-reviewer team
-
Mailing list archive
-
Message #07243
[Merge] lp:~akretion-team/sale-wkfl/7.0-addmulticpny-sale-except-module-dbl into lp:sale-wkfl
David BEAL (ak) has proposed merging lp:~akretion-team/sale-wkfl/7.0-addmulticpny-sale-except-module-dbl into lp:sale-wkfl.
Requested reviews:
Sale Core Editors (sale-core-editors)
For more details, see:
https://code.launchpad.net/~akretion-team/sale-wkfl/7.0-addmulticpny-sale-except-module-dbl/+merge/223750
add multicompany support to sale_exceptions module
--
https://code.launchpad.net/~akretion-team/sale-wkfl/7.0-addmulticpny-sale-except-module-dbl/+merge/223750
Your team Sale Core Editors is requested to review the proposed merge of lp:~akretion-team/sale-wkfl/7.0-addmulticpny-sale-except-module-dbl into lp:sale-wkfl.
=== modified file 'sale_exceptions/__openerp__.py'
--- sale_exceptions/__openerp__.py 2013-11-15 12:19:07 +0000
+++ sale_exceptions/__openerp__.py 2014-06-19 13:54:05 +0000
@@ -21,26 +21,48 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
+
{'name': 'Sale Exceptions',
- 'version': '0.1',
+ 'version': '1.0.0',
'category': 'Generic Modules/Sale',
'description': """
+
+DESCRIPTION
+============
This module allows you attach several customizable exceptions to your sale order
in a way that you can filter orders by exceptions type and fix them.
This is especially useful in an order importation scenario such as with
the base_sale_multi_channels module, because it's likely a few orders have errors
when you import them (like product not found in OpenERP, wrong line format etc...)
+
+
+AUTHORS
+========
+
+Akretion
+----------
+ - Raphaël Valyi
+ - Renato Lima
+ - Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>
+
+Camptocamp
+-----------
+ - Guewen Baconnier
+
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['sale'],
- 'init_xml': ['settings/sale.exception.csv'],
- 'update_xml': ['sale_workflow.xml',
- 'sale_view.xml',
- 'sale_exceptions_data.xml',
- 'wizard/sale_exception_confirm_view.xml',
- 'security/ir.model.access.csv'],
- 'demo_xml': [],
+ 'data': [
+ 'settings/sale.exception.csv',
+ 'sale_workflow.xml',
+ 'sale_view.xml',
+ 'sale_exceptions_data.xml',
+ 'wizard/sale_exception_confirm_view.xml',
+ 'security/ir.model.access.csv',
+ 'security/rule.xml',
+ ],
+ 'demo': [],
'installable': True,
}
=== modified file 'sale_exceptions/sale.py'
--- sale_exceptions/sale.py 2013-11-15 12:55:29 +0000
+++ sale_exceptions/sale.py 2014-06-19 13:54:05 +0000
@@ -28,12 +28,13 @@
from openerp.tools.translate import _
-class sale_exception(orm.Model):
+class SaleException(orm.Model):
_name = "sale.exception"
_description = "Sale Exceptions"
_order = "active desc, sequence asc"
_columns = {
'name': fields.char('Exception Name', required=True, translate=True),
+ 'company_id': fields.many2one('res.company', 'Company'),
'description': fields.text('Description', translate=True),
'sequence': fields.integer(
'Sequence',
@@ -64,11 +65,12 @@
# - cr: database cursor
# - uid: current user id
# - context: current context
-"""
+""",
+ 'company_id': lambda s, cr, uid, c: s.pool['res.company']._company_default_get(cr, uid, 'sale.exception', context=c),
}
-class sale_order(orm.Model):
+class SaleOrder(orm.Model):
_inherit = "sale.order"
_order = 'main_exception_id asc, date_order desc, name desc'
@@ -133,8 +135,8 @@
if exception_ids:
return self._popup_exceptions(cr, uid, ids[0], context=context)
else:
- return super(sale_order, self).action_button_confirm(cr, uid, ids,
- context=context)
+ return super(SaleOrder, self).action_button_confirm(cr, uid, ids,
+ context=context)
def test_exceptions(self, cr, uid, ids, context=None):
"""
@@ -233,4 +235,4 @@
default.update({
'ignore_exceptions': False,
})
- return super(sale_order, self).copy(cr, uid, id, default=default, context=context)
+ return super(SaleOrder, self).copy(cr, uid, id, default=default, context=context)
=== modified file 'sale_exceptions/sale_view.xml'
--- sale_exceptions/sale_view.xml 2013-11-15 12:55:29 +0000
+++ sale_exceptions/sale_view.xml 2014-06-19 13:54:05 +0000
@@ -28,9 +28,10 @@
<group col="4" colspan="4" groups="base.group_sale_manager">
<field name="active"/>
<field name="sequence"/>
- <group colspan="4" col="2" groups="base.group_system">
+ <group colspan="4" col="4" groups="base.group_system">
<field name="model"/>
- <field name="code"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ <field name="code" colspan="4"/>
</group>
</group>
<group colspan="4" col="2">
=== added file 'sale_exceptions/security/rule.xml'
--- sale_exceptions/security/rule.xml 1970-01-01 00:00:00 +0000
+++ sale_exceptions/security/rule.xml 2014-06-19 13:54:05 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data noupdate="1">
+
+ <record id="sale_exception_comp_rule" model="ir.rule">
+ <field name="name">Sale exception multi-company</field>
+ <field name="model_id" ref="model_sale_exception"/>
+ <field name="global" eval="True"/>
+ <field name="domain_force">
+['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+ </record>
+
+ </data>
+</openerp>
Follow ups