From 13c6176f1e5490f388071c4263b8e9eb5a56f406 Mon Sep 17 00:00:00 2001 From: jmf Date: Fri, 20 May 2016 23:34:32 +0200 Subject: [PATCH 01/10] [ADD] Added max_shipping_date, responsible person --- beesdoo_inventory/__init__.py | 2 ++ beesdoo_inventory/__openerp__.py | 31 ++++++++++++++++++++++++++++ beesdoo_inventory/models/__init__.py | 2 ++ beesdoo_inventory/models/stock.py | 8 +++++++ beesdoo_inventory/views/stock.xml | 18 ++++++++++++++++ 5 files changed, 61 insertions(+) create mode 100644 beesdoo_inventory/__init__.py create mode 100644 beesdoo_inventory/__openerp__.py create mode 100644 beesdoo_inventory/models/__init__.py create mode 100644 beesdoo_inventory/models/stock.py create mode 100644 beesdoo_inventory/views/stock.xml diff --git a/beesdoo_inventory/__init__.py b/beesdoo_inventory/__init__.py new file mode 100644 index 0000000..0f7cb6b --- /dev/null +++ b/beesdoo_inventory/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +import models \ No newline at end of file diff --git a/beesdoo_inventory/__openerp__.py b/beesdoo_inventory/__openerp__.py new file mode 100644 index 0000000..03e6d33 --- /dev/null +++ b/beesdoo_inventory/__openerp__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +{ + 'name': "beesdoo_inventory", + + 'summary': """ + Modification of inventory data for the needs of beescoop + - SOO24 - Bon de livraison""", + + 'description': """ + + """, + + 'author': "Beescoop - Cellule IT", + 'website': "https://github.com/beescoop/Obeesdoo", + + # Categories can be used to filter modules in modules listing + # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml + # for the full list + 'category': 'Sales Management', + 'version': '0.1', + + # any module necessary for this one to work correctly + 'depends': ['delivery'], + + # always loaded + 'data': [ + 'views/stock.xml' ], + + # only loaded in demonstration mode + 'demo': [], +} \ No newline at end of file diff --git a/beesdoo_inventory/models/__init__.py b/beesdoo_inventory/models/__init__.py new file mode 100644 index 0000000..9d94072 --- /dev/null +++ b/beesdoo_inventory/models/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +import stock \ No newline at end of file diff --git a/beesdoo_inventory/models/stock.py b/beesdoo_inventory/models/stock.py new file mode 100644 index 0000000..562f6c9 --- /dev/null +++ b/beesdoo_inventory/models/stock.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from openerp import models, fields, api, _ + +class StockPicking(models.Model): + _inherit = 'stock.picking' + + max_shipping_date = fields.Datetime("End Shipping Date") + responsible = fields.Many2one("res.partner", string="Responsible Person") diff --git a/beesdoo_inventory/views/stock.xml b/beesdoo_inventory/views/stock.xml new file mode 100644 index 0000000..bdd0877 --- /dev/null +++ b/beesdoo_inventory/views/stock.xml @@ -0,0 +1,18 @@ + + + + + beesdoo.stock.form.view + stock.picking + + + + + + + + + + + + \ No newline at end of file From 828a61f59d156a1ee380fd1994ca270eefffe3ce Mon Sep 17 00:00:00 2001 From: jmf Date: Sat, 21 May 2016 01:05:20 +0200 Subject: [PATCH 02/10] [IMPL] Added mail.followers --- beesdoo_inventory/models/stock.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/beesdoo_inventory/models/stock.py b/beesdoo_inventory/models/stock.py index 562f6c9..efcbc72 100644 --- a/beesdoo_inventory/models/stock.py +++ b/beesdoo_inventory/models/stock.py @@ -6,3 +6,24 @@ class StockPicking(models.Model): max_shipping_date = fields.Datetime("End Shipping Date") responsible = fields.Many2one("res.partner", string="Responsible Person") + + def _add_follower(self): + self.env['mail.followers'].create({'partner_id': self.responsible.id, + 'res_id': self.id, + 'res_model': "stock.picking",}) + + @api.multi + def write(self, values): + res = super(StockPicking, self).write(values) + print "WRITE" + print values.get('responsible') + if values.get('responsible'): + for picking in self: + picking._add_follower() + return res + + @api.model + def create(self, values): + picking = super(StockPicking, self).create(values) + picking._add_follower() + return picking \ No newline at end of file From 93a77c6284504bb92136366734f7bc3a73c09c47 Mon Sep 17 00:00:00 2001 From: jmf Date: Sat, 21 May 2016 01:32:45 +0200 Subject: [PATCH 03/10] [IMPL] Added 'responsible person' to stock picking tree view --- beesdoo_inventory/views/stock.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/beesdoo_inventory/views/stock.xml b/beesdoo_inventory/views/stock.xml index bdd0877..85fe537 100644 --- a/beesdoo_inventory/views/stock.xml +++ b/beesdoo_inventory/views/stock.xml @@ -1,6 +1,17 @@ + + beesdoo.stock.tree.view + stock.picking + + + + + + + + beesdoo.stock.form.view stock.picking From 56e7fbdf8dfb616501429a5f23275d034d92f000 Mon Sep 17 00:00:00 2001 From: EliseDup Date: Wed, 19 Oct 2016 09:48:00 +0200 Subject: [PATCH 04/10] Fix S0024 : add responsible as follower --- beesdoo_inventory/models/stock.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/beesdoo_inventory/models/stock.py b/beesdoo_inventory/models/stock.py index efcbc72..4d76c9a 100644 --- a/beesdoo_inventory/models/stock.py +++ b/beesdoo_inventory/models/stock.py @@ -5,21 +5,20 @@ class StockPicking(models.Model): _inherit = 'stock.picking' max_shipping_date = fields.Datetime("End Shipping Date") - responsible = fields.Many2one("res.partner", string="Responsible Person") + responsible = fields.Many2one('res.partner', string="Responsible") def _add_follower(self): - self.env['mail.followers'].create({'partner_id': self.responsible.id, - 'res_id': self.id, - 'res_model': "stock.picking",}) + if(self.responsible): + types = self.env['mail.message.subtype'].search(['|',('res_model','=','stock.picking'),('name','=','Discussions')]) + self.env['mail.followers'].create({'res_model' : 'stock.picking', + 'res_id' : self.id, + 'partner_id' : self.responsible.id, + 'subtype_ids': [(6, 0, types.ids)]}) @api.multi def write(self, values): res = super(StockPicking, self).write(values) - print "WRITE" - print values.get('responsible') - if values.get('responsible'): - for picking in self: - picking._add_follower() + self._add_follower() return res @api.model From 3789e5b9fcdc6f951670cbf22e1236ce02879ecf Mon Sep 17 00:00:00 2001 From: Thibault Francois Date: Sun, 13 Nov 2016 16:27:07 +0100 Subject: [PATCH 05/10] [ADD] translation file for each individual module --- beesdoo_inventory/i18n/fr_BE.po | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 beesdoo_inventory/i18n/fr_BE.po diff --git a/beesdoo_inventory/i18n/fr_BE.po b/beesdoo_inventory/i18n/fr_BE.po new file mode 100644 index 0000000..b2e4091 --- /dev/null +++ b/beesdoo_inventory/i18n/fr_BE.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * beesdoo_inventory +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-13 15:22+0000\n" +"PO-Revision-Date: 2016-11-13 15:22+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: beesdoo_inventory +#: model:ir.model.fields,field_description:beesdoo_inventory.field_stock_picking_max_shipping_date +msgid "End Shipping Date" +msgstr "End Shipping Date" + +#. module: beesdoo_inventory +#: model:ir.ui.view,arch_db:beesdoo_inventory.beesdoo_stock_form_view +msgid "Max shipping date" +msgstr "Max shipping date" + +#. module: beesdoo_inventory +#: model:ir.model.fields,field_description:beesdoo_inventory.field_stock_picking_responsible +msgid "Responsible" +msgstr "Responsable" + +#. module: beesdoo_inventory +#: model:ir.model,name:beesdoo_inventory.model_stock_picking +msgid "Transfer" +msgstr "Transfert" + From 6330e28c911d4636d5d771e1110147d12aa5cac0 Mon Sep 17 00:00:00 2001 From: tfrancoi Date: Tue, 21 Feb 2017 22:16:15 +0100 Subject: [PATCH 06/10] =?UTF-8?q?[S0046]=200046=20-=20Faciliter=20la=20r?= =?UTF-8?q?=C3=A9ception=20de=20marchandises:=20Add=20a=20button=20to=20co?= =?UTF-8?q?py=20all=20qty=20in=20done=20column=20at=20reception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beesdoo_inventory/__openerp__.py | 2 +- beesdoo_inventory/models/stock.py | 12 ++++++++++-- beesdoo_inventory/views/stock.xml | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/beesdoo_inventory/__openerp__.py b/beesdoo_inventory/__openerp__.py index 03e6d33..80b9ff8 100644 --- a/beesdoo_inventory/__openerp__.py +++ b/beesdoo_inventory/__openerp__.py @@ -20,7 +20,7 @@ 'version': '0.1', # any module necessary for this one to work correctly - 'depends': ['delivery'], + 'depends': ['delivery', 'beesdoo_base'], # always loaded 'data': [ diff --git a/beesdoo_inventory/models/stock.py b/beesdoo_inventory/models/stock.py index 4d76c9a..5ee2cfd 100644 --- a/beesdoo_inventory/models/stock.py +++ b/beesdoo_inventory/models/stock.py @@ -8,7 +8,7 @@ class StockPicking(models.Model): responsible = fields.Many2one('res.partner', string="Responsible") def _add_follower(self): - if(self.responsible): + if(self.responsible): types = self.env['mail.message.subtype'].search(['|',('res_model','=','stock.picking'),('name','=','Discussions')]) self.env['mail.followers'].create({'res_model' : 'stock.picking', 'res_id' : self.id, @@ -23,6 +23,14 @@ class StockPicking(models.Model): @api.model def create(self, values): + print "Values", values picking = super(StockPicking, self).create(values) picking._add_follower() - return picking \ No newline at end of file + return picking + + @api.multi + def copy_qty(self): + self.ensure_one() + for pack_operation in self.pack_operation_product_ids: + pack_operation.qty_done = pack_operation.product_qty + return True \ No newline at end of file diff --git a/beesdoo_inventory/views/stock.xml b/beesdoo_inventory/views/stock.xml index 85fe537..d095f3f 100644 --- a/beesdoo_inventory/views/stock.xml +++ b/beesdoo_inventory/views/stock.xml @@ -23,6 +23,10 @@ + From c0ad80b0fcf109af1cd5ef1502c72180dc2a775b Mon Sep 17 00:00:00 2001 From: Thibault Francois Date: Sat, 1 Jul 2017 15:40:47 +0200 Subject: [PATCH 07/10] [FIX] [0024-Bug] cannot set two times the same responsible --- beesdoo_inventory/models/stock.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/beesdoo_inventory/models/stock.py b/beesdoo_inventory/models/stock.py index 5ee2cfd..cf09b0f 100644 --- a/beesdoo_inventory/models/stock.py +++ b/beesdoo_inventory/models/stock.py @@ -10,7 +10,10 @@ class StockPicking(models.Model): def _add_follower(self): if(self.responsible): types = self.env['mail.message.subtype'].search(['|',('res_model','=','stock.picking'),('name','=','Discussions')]) - self.env['mail.followers'].create({'res_model' : 'stock.picking', + if not self.env['mail.followers'].search([('res_id', '=', self.id), + ('res_model', '=', 'stock.picking'), + ('partner_id', '=', self.responsible.id)]): + self.env['mail.followers'].create({'res_model' : 'stock.picking', 'res_id' : self.id, 'partner_id' : self.responsible.id, 'subtype_ids': [(6, 0, types.ids)]}) @@ -23,7 +26,6 @@ class StockPicking(models.Model): @api.model def create(self, values): - print "Values", values picking = super(StockPicking, self).create(values) picking._add_follower() return picking From cb1b782314fa1eb49c964fde6c8a76b3cb66ae89 Mon Sep 17 00:00:00 2001 From: Thibault Francois Date: Sat, 1 Dec 2018 17:34:53 +0100 Subject: [PATCH 08/10] [CHANGE][0045 - Date de livraison dans le bon de commande] Remove date_planned and button to set date in tab delivery Add a new field manual_date_planned Onchange on order_line to set the first time a date planned Force the manual_date_planned to all line at confirmation Change the report for purchase order [ADD] default value on picking responsible: set the create_uid as responsible (this mean the one that confirm the purchase order --- beesdoo_inventory/models/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beesdoo_inventory/models/stock.py b/beesdoo_inventory/models/stock.py index cf09b0f..6016de3 100644 --- a/beesdoo_inventory/models/stock.py +++ b/beesdoo_inventory/models/stock.py @@ -5,7 +5,7 @@ class StockPicking(models.Model): _inherit = 'stock.picking' max_shipping_date = fields.Datetime("End Shipping Date") - responsible = fields.Many2one('res.partner', string="Responsible") + responsible = fields.Many2one('res.partner', string="Responsible", default=lambda self: self.env.user.partner_id.id) def _add_follower(self): if(self.responsible): From f0770ff02ffcd87d515ef6beb0f75c27a8277492 Mon Sep 17 00:00:00 2001 From: Augustin Borsu Date: Sat, 8 Jun 2019 16:05:53 +0200 Subject: [PATCH 09/10] [IMP] beesdoo_inventory: add filter on add item to reciept Added a domain to filter proposed products on the reciept view. Only products whose main seller are the reciept's partner are proposed in the auto-complete/selection. --- beesdoo_inventory/__openerp__.py | 2 +- beesdoo_inventory/views/stock.xml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/beesdoo_inventory/__openerp__.py b/beesdoo_inventory/__openerp__.py index 80b9ff8..5c47099 100644 --- a/beesdoo_inventory/__openerp__.py +++ b/beesdoo_inventory/__openerp__.py @@ -17,7 +17,7 @@ # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml # for the full list 'category': 'Sales Management', - 'version': '0.1', + 'version': '9.0.1.0.0', # any module necessary for this one to work correctly 'depends': ['delivery', 'beesdoo_base'], diff --git a/beesdoo_inventory/views/stock.xml b/beesdoo_inventory/views/stock.xml index d095f3f..e783655 100644 --- a/beesdoo_inventory/views/stock.xml +++ b/beesdoo_inventory/views/stock.xml @@ -27,7 +27,10 @@ + + [('main_seller_id', '=', parent.partner_id)] + - \ No newline at end of file + From 89174809c108b5ced968a9bf143de4dd31d5cc0d Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Sun, 17 Nov 2019 12:11:26 +0100 Subject: [PATCH 10/10] [MIG] beesdoo_inventory: migrate to 12.0 --- beesdoo_inventory/__init__.py | 3 +- .../{__openerp__.py => __manifest__.py} | 11 +++-- beesdoo_inventory/models/__init__.py | 3 +- beesdoo_inventory/models/stock.py | 3 +- beesdoo_inventory/views/stock.xml | 44 +++++++++---------- 5 files changed, 29 insertions(+), 35 deletions(-) rename beesdoo_inventory/{__openerp__.py => __manifest__.py} (76%) diff --git a/beesdoo_inventory/__init__.py b/beesdoo_inventory/__init__.py index 0f7cb6b..0650744 100644 --- a/beesdoo_inventory/__init__.py +++ b/beesdoo_inventory/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- -import models \ No newline at end of file +from . import models diff --git a/beesdoo_inventory/__openerp__.py b/beesdoo_inventory/__manifest__.py similarity index 76% rename from beesdoo_inventory/__openerp__.py rename to beesdoo_inventory/__manifest__.py index 5c47099..1e8266b 100644 --- a/beesdoo_inventory/__openerp__.py +++ b/beesdoo_inventory/__manifest__.py @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- { - 'name': "beesdoo_inventory", + 'name': "Beesdoo Inventory", 'summary': """ - Modification of inventory data for the needs of beescoop - - SOO24 - Bon de livraison""", + Adds a responsible, a max shipping date and a button to copy quantity to + stock pickings.""", 'description': """ @@ -17,7 +16,7 @@ # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml # for the full list 'category': 'Sales Management', - 'version': '9.0.1.0.0', + 'version': '12.0.1.0.0', # any module necessary for this one to work correctly 'depends': ['delivery', 'beesdoo_base'], @@ -28,4 +27,4 @@ # only loaded in demonstration mode 'demo': [], -} \ No newline at end of file +} diff --git a/beesdoo_inventory/models/__init__.py b/beesdoo_inventory/models/__init__.py index 9d94072..12bab77 100644 --- a/beesdoo_inventory/models/__init__.py +++ b/beesdoo_inventory/models/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- -import stock \ No newline at end of file +from . import stock diff --git a/beesdoo_inventory/models/stock.py b/beesdoo_inventory/models/stock.py index 6016de3..0751215 100644 --- a/beesdoo_inventory/models/stock.py +++ b/beesdoo_inventory/models/stock.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -from openerp import models, fields, api, _ +from odoo import _, api, fields, models class StockPicking(models.Model): _inherit = 'stock.picking' diff --git a/beesdoo_inventory/views/stock.xml b/beesdoo_inventory/views/stock.xml index e783655..f815e9d 100644 --- a/beesdoo_inventory/views/stock.xml +++ b/beesdoo_inventory/views/stock.xml @@ -1,36 +1,34 @@ + + beesdoo.stock.tree.view + stock.picking + + + + + + + - - beesdoo.stock.tree.view - stock.picking - - - - - - - - - - beesdoo.stock.form.view - stock.picking - - - - - + + beesdoo.stock.form.view + stock.picking + + + + + - [('main_seller_id', '=', parent.partner_id)] - - - + +