Merge lp:~numerigraphe-team/purchase-wkfl/7.0-add-purchase_delivery_split_date into lp:~purchase-core-editors/purchase-wkfl/7.0

Proposed by Lionel Sausin - Initiatives/Numérigraphe
Status: Needs review
Proposed branch: lp:~numerigraphe-team/purchase-wkfl/7.0-add-purchase_delivery_split_date
Merge into: lp:~purchase-core-editors/purchase-wkfl/7.0
Diff against target: 121 lines (+106/-0)
3 files modified
purchase_delivery_split_date/__init__.py (+21/-0)
purchase_delivery_split_date/__openerp__.py (+41/-0)
purchase_delivery_split_date/purchase.py (+44/-0)
To merge this branch: bzr merge lp:~numerigraphe-team/purchase-wkfl/7.0-add-purchase_delivery_split_date
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza Needs Resubmitting
Yannick Vaucher @ Camptocamp code review, no test Approve
Lorenzo Battistini (community) code review Approve
Joël Grand-Guillaume @ camptocamp code review, no tests Needs Fixing
Loïc Bellier - Numérigraphe (community) code review Approve
Review via email: mp+211374@code.launchpad.net

Description of the change

This branch adds a new module which, when installed, creates one reception picking for each expected date on the purchase order.
This way stock workers have a clear view of which goods should be received when.

This modules uses the modular design of purchase orders to create several pickings rather that a single one: to the best f my knowledge, this should be compatible with the other modules in this branch.

To post a comment you must log in.
31. By Numérigraphe

[ADD] authors file

Revision history for this message
Loïc Bellier - Numérigraphe (lb-b) :
review: Approve (code review)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi Lionel,

Thanks for the contrib ! A few remarks concerning community guideline:

 * L32 : use from . import purchase
 * L95 : use full path instead : from openerp.osv import orm
 * L114 : use let a print, remove it please

Otherwise, LGTM,

Regards,

Joël

review: Needs Fixing (code review, no tests)
32. By Numérigraphe

[REF] explicit import paths. Updated authors file. Use itervalues() when we don't need the keys

Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

Thanks Joël, I've updated the module as you suggested.

Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Please don't add AUTHOR.txt file and add Contributors in __openerp__.py

For who did exaclty what there is the CVS

review: Needs Fixing
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

Yannick, I agree, but I thought it was required for OCA modules - I can't remember why I assumed that, maybe read it in some guide somewhere.
I'll fix it.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Here is the reference for this community Guideline.

https://doc.openerp.com/contribute/05_developing_modules/#modules-description

This has the advantage to show who contributed directly on apps.odoo.com as we don't have such field in manifest.

33. By Numérigraphe

[DEL] remove AUTHORS file - annotate will tell whom to blame

Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

I moved the crediting to a comment in __openerp__.py, is it right?

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
34. By Numérigraphe

[IMP] Make a 'contributor' paragraph

Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

I think it's fixed now.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Perfect, thanks for the changes Lionel

review: Approve (code review, no test)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

This project is now hosted on https://github.com/OCA/purchase-workflow. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Needs Resubmitting

Unmerged revisions

34. By Numérigraphe

[IMP] Make a 'contributor' paragraph

33. By Numérigraphe

[DEL] remove AUTHORS file - annotate will tell whom to blame

32. By Numérigraphe

[REF] explicit import paths. Updated authors file. Use itervalues() when we don't need the keys

31. By Numérigraphe

[ADD] authors file

30. By Numérigraphe

[ADD] Module to split purchase receptions into 1 picking by expected date

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'purchase_delivery_split_date'
=== added file 'purchase_delivery_split_date/__init__.py'
--- purchase_delivery_split_date/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_delivery_split_date/__init__.py 2014-05-19 11:29:31 +0000
@@ -0,0 +1,21 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved.
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21from . import purchase
022
=== added file 'purchase_delivery_split_date/__openerp__.py'
--- purchase_delivery_split_date/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_delivery_split_date/__openerp__.py 2014-05-19 11:29:31 +0000
@@ -0,0 +1,41 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved.
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21{
22 'name': "Purchase Deliveries split by date",
23 'version': '1.0',
24 'author': u'Numérigraphe',
25 'category': 'Purchase Management',
26 'description': """
27Split Purchase Deliveries in one reception per expected date
28------------------------------------------------------------
29
30When this module is installed, each Purchase Order you confirm will generate one
31Reception Order per delivery date indicated in the Purchase Order Lines.
32
33Contributors
34------------
35
36 * Philippe Rossi <pr@numerigraphe.com> (initial patch against v6.0)
37 * Lionel Sausin <ls@numerigraphe.com> (modularization for v7.0)
38""",
39 'license': 'AGPL-3',
40 "depends": ['purchase'],
41}
042
=== added file 'purchase_delivery_split_date/purchase.py'
--- purchase_delivery_split_date/purchase.py 1970-01-01 00:00:00 +0000
+++ purchase_delivery_split_date/purchase.py 2014-05-19 11:29:31 +0000
@@ -0,0 +1,44 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved.
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21from openerp.osv import orm
22
23
24class PurchaseOrder(orm.Model):
25 _inherit = "purchase.order"
26
27 def _create_pickings(self, cr, uid, order, order_lines, picking_id=False,
28 context=None):
29 """Group the Purchase Order's receptions by expected date"""
30 picking_ids = []
31 delivery_dates = {}
32 # Triage the order lines by delivery date
33 for line in order_lines:
34 if line.date_planned in delivery_dates:
35 delivery_dates[line.date_planned].append(line)
36 else:
37 delivery_dates[line.date_planned] = [line]
38 # Process each group of lines
39 for lines in delivery_dates.itervalues():
40 picking_ids.extend(
41 super(PurchaseOrder, self)._create_pickings(
42 cr, uid, order, lines, picking_id=picking_id,
43 context=context))
44 return picking_ids

Subscribers

People subscribed via source and target branches