diff --git a/__init__.py b/__init__.py index aa081c7fe..3c4dc4909 100644 --- a/__init__.py +++ b/__init__.py @@ -2,5 +2,4 @@ # © 2011 Raphaël Valyi, Renato Lima, Guewen Baconnier, Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import sale -from . import wizard +from . import wizard, models diff --git a/__openerp__.py b/__openerp__.py index 39d0153d9..a582c2115 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -9,12 +9,14 @@ 'author': "Akretion, Sodexis, Odoo Community Association (OCA)", 'website': 'http://www.akretion.com', 'depends': ['sale'], + 'license': 'AGPL-3', 'data': [ 'security/ir.model.access.csv', 'wizard/sale_exception_confirm_view.xml', - 'settings/sale.exception.csv', - 'sale_exception_data.xml', - 'sale_view.xml', + 'data/sale.exception.csv', + 'data/sale_exception_data.xml', + 'views/sale_view.xml', ], + 'images': [], 'installable': True, } diff --git a/settings/sale.exception.csv b/data/sale.exception.csv similarity index 100% rename from settings/sale.exception.csv rename to data/sale.exception.csv diff --git a/sale_exception_data.xml b/data/sale_exception_data.xml similarity index 100% rename from sale_exception_data.xml rename to data/sale_exception_data.xml diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 000000000..bc7f66f92 --- /dev/null +++ b/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2011 Raphaël Valyi, Renato Lima, Guewen Baconnier, Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import sale diff --git a/sale.py b/models/sale.py similarity index 97% rename from sale.py rename to models/sale.py index e2df88ab4..5e99c800e 100644 --- a/sale.py +++ b/models/sale.py @@ -4,10 +4,9 @@ import time -from openerp import api, models, fields -from openerp.exceptions import Warning +from openerp import api, models, fields, _ +from openerp.exceptions import UserError from openerp.tools.safe_eval import safe_eval -from openerp.tools.translate import _ class SaleException(models.Model): @@ -163,7 +162,7 @@ class SaleOrder(models.Model): mode='exec', nocopy=True) # nocopy allows to return 'result' except Exception, e: - raise Warning( + raise UserError( _('Error when evaluating the sale exception ' 'rule:\n %s \n(%s)') % (rule.name, e)) return space.get('failed', False) diff --git a/sale_view.xml b/views/sale_view.xml similarity index 100% rename from sale_view.xml rename to views/sale_view.xml