← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~camptocamp/sale-wkfl/add-sale_exception_nostock_by_line-jge into lp:sale-wkfl

 

Joël Grand-Guillaume @ camptocamp has proposed merging lp:~camptocamp/sale-wkfl/add-sale_exception_nostock_by_line-jge into lp:sale-wkfl.

Commit message:
[ADD] module sale_exception_nostock_by_line that make the module sale_exception_nostock and sale_sourced_by_line working together

Requested reviews:
  Sale Core Editors (sale-core-editors)

For more details, see:
https://code.launchpad.net/~camptocamp/sale-wkfl/add-sale_exception_nostock_by_line-jge/+merge/193597

Hi,


This proposal add the small module sale_exception_nostock_by_line that make the module sale_exception_nostock and sale_sourced_by_line working together.

The principle of the no-stock exception is to raise a warning when no enough stock are
gound in the location of the SO shop. This module make the warning occure for every line
location instead of looking at the shop location for all line.

WARNING : Those 2 MP should be merged first:

https://code.launchpad.net/~camptocamp/sale-wkfl/add-sale_exception_nostock-jge/+merge/193591
https://code.launchpad.net/~camptocamp/sale-wkfl/add-sale_sourced_by_line-jge/+merge/193594


Regards,

-- 
https://code.launchpad.net/~camptocamp/sale-wkfl/add-sale_exception_nostock_by_line-jge/+merge/193597
Your team Sale Core Editors is requested to review the proposed merge of lp:~camptocamp/sale-wkfl/add-sale_exception_nostock_by_line-jge into lp:sale-wkfl.
=== added directory 'sale_exception_nostock_by_line'
=== added file 'sale_exception_nostock_by_line/__init__.py'
--- sale_exception_nostock_by_line/__init__.py	1970-01-01 00:00:00 +0000
+++ sale_exception_nostock_by_line/__init__.py	2013-11-01 13:19:26 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Joel Grand-Guillaume
+#    Copyright 2013 Camptocamp SA
+#
+#    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 . import model

=== added file 'sale_exception_nostock_by_line/__openerp__.py'
--- sale_exception_nostock_by_line/__openerp__.py	1970-01-01 00:00:00 +0000
+++ sale_exception_nostock_by_line/__openerp__.py	2013-11-01 13:19:26 +0000
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Joel Grand-Guillaume
+#    Copyright 2013 Camptocamp SA
+#
+#    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/>.
+#
+##############################################################################
+
+{'name': 'Sale No stock by line',
+ 'version': '0.1',
+ 'author': 'Camptocamp',
+ 'category': 'Warehouse',
+ 'license': 'AGPL-3',
+ 'complexity': 'expert',
+ 'images': [],
+ 'website': "http://www.camptocamp.com";,
+ 'description': """
+Sale No stock by line
+=====================
+
+This module depends on both sale_exception_nostock and sale_sourced_by_line and make the 
+exception occure based on the location of each line.
+
+The principle of the no-stock exception is to raise a warning when no enough stock are
+gound in the location of the SO shop. This module make the warning occure for every line
+location instead of looking at the shop location for all line.
+
+""",
+ 'depends': [
+    'sale_exception_nostock',
+    'sale_sourced_by_line',
+             ],
+ 'demo': [],
+ 'data': [],
+ 'test': [],
+ 'auto_install': False,
+ 'installable': True,
+ }

=== added directory 'sale_exception_nostock_by_line/i18n'
=== added directory 'sale_exception_nostock_by_line/model'
=== added file 'sale_exception_nostock_by_line/model/__init__.py'
--- sale_exception_nostock_by_line/model/__init__.py	1970-01-01 00:00:00 +0000
+++ sale_exception_nostock_by_line/model/__init__.py	2013-11-01 13:19:26 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Guewen Baconnier
+#    Copyright 2013 Camptocamp SA
+#
+#    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 . import sale

=== added file 'sale_exception_nostock_by_line/model/sale.py'
--- sale_exception_nostock_by_line/model/sale.py	1970-01-01 00:00:00 +0000
+++ sale_exception_nostock_by_line/model/sale.py	2013-11-01 13:19:26 +0000
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Joel Grand-Guillaume
+#    Copyright 2013 Camptocamp SA
+#
+#    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 orm
+
+
+class sale_order_line(orm.Model):
+    """Override the _get_line_location method to look at the right
+    one for every line instead of taking the shop location for all."""
+
+    _inherit = "sale.order.line"
+
+    def _get_line_location(self, line_br, context=None):
+        return line_br.location_id.id
+


Follow ups