From 42233bc0cec8acc9bf5c4a57d055ebac6b8efaf6 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 27 Oct 2016 09:33:15 +0200 Subject: [PATCH] Port base_usability, sale_usability, sale_stock_usability to v10 --- base_usability/__init__.py | 1 - base_usability/__manifest__.py | 31 +++-------- base_usability/country_view.xml | 14 +++-- base_usability/ir_sequence.py | 48 ----------------- base_usability/mail.py | 34 +++--------- base_usability/misc.py | 24 ++------- base_usability/module_view.xml | 37 ++++++------- base_usability/partner.py | 57 +++++++++------------ base_usability/partner_view.xml | 27 +++------- base_usability/security/group.xml | 6 +-- base_usability/security/ir.model.access.csv | 1 + base_usability/translation_view.xml | 23 --------- sale_stock_usability/__manifest__.py | 25 ++------- sale_stock_usability/sale_stock.py | 47 ++--------------- sale_stock_usability/sale_stock_view.xml | 43 +++------------- sale_usability/__init__.py | 1 - sale_usability/__manifest__.py | 26 ++-------- sale_usability/account_invoice.py | 32 ------------ sale_usability/sale.py | 37 +++++-------- sale_usability/sale_view.xml | 52 +++++++++++-------- stock_usability/__manifest__.py | 25 ++------- stock_usability/stock.py | 34 +++++------- stock_usability/stock_view.xml | 13 +++++ 23 files changed, 164 insertions(+), 474 deletions(-) delete mode 100644 base_usability/ir_sequence.py delete mode 100644 base_usability/translation_view.xml delete mode 100644 sale_usability/account_invoice.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index 1baafee..a0c9233 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -3,4 +3,3 @@ from . import partner from . import mail from . import misc -from . import ir_sequence diff --git a/base_usability/__manifest__.py b/base_usability/__manifest__.py index b38e5dd..fecea96 100644 --- a/base_usability/__manifest__.py +++ b/base_usability/__manifest__.py @@ -1,25 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2014-2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- +# © 2014-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Base Usability', @@ -44,14 +26,13 @@ A group by 'State' is added to module search view. """, 'author': 'Akretion', 'website': 'http://www.akretion.com', - 'depends': ['base', 'mail'], + 'depends': ['base'], 'data': [ 'security/group.xml', 'security/ir.model.access.csv', 'partner_view.xml', 'country_view.xml', 'module_view.xml', - 'translation_view.xml', ], - 'installable': False, + 'installable': True, } diff --git a/base_usability/country_view.xml b/base_usability/country_view.xml index fcb048c..9a5e486 100644 --- a/base_usability/country_view.xml +++ b/base_usability/country_view.xml @@ -1,12 +1,11 @@ - - + base_usability.res.country.state.search @@ -43,11 +42,10 @@ res.country - + - - + diff --git a/base_usability/ir_sequence.py b/base_usability/ir_sequence.py deleted file mode 100644 index 1d7f014..0000000 --- a/base_usability/ir_sequence.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2016 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - -from openerp import models, fields -from datetime import datetime -import pytz - - -class IrSequence(models.Model): - _inherit = 'ir.sequence' - - def _interpolation_dict_context(self, context=None): - if context is None: - context = {} - t = False - if context.get('force_sequence_date'): - date_str = context['force_sequence_date'] - if isinstance(date_str, (str, unicode)) and len(date_str) == 10: - t = fields.Date.from_string(date_str) - if not t: - t = datetime.now(pytz.timezone(context.get('tz') or 'UTC')) - sequences = { - 'year': '%Y', 'month': '%m', 'day': '%d', 'y': '%y', 'doy': '%j', - 'woy': '%W', - 'weekday': '%w', 'h24': '%H', 'h12': '%I', 'min': '%M', 'sec': '%S' - } - return { - key: t.strftime(sequence) - for key, sequence in sequences.iteritems()} diff --git a/base_usability/mail.py b/base_usability/mail.py index a9cd095..c507cbe 100644 --- a/base_usability/mail.py +++ b/base_usability/mail.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com/) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models +from odoo import models, api import logging logger = logging.getLogger(__name__) @@ -29,18 +11,18 @@ logger = logging.getLogger(__name__) class IrMailServer(models.Model): _inherit = "ir.mail_server" + @api.model def send_email( - self, cr, uid, message, mail_server_id=None, smtp_server=None, + self, message, mail_server_id=None, smtp_server=None, smtp_port=None, smtp_user=None, smtp_password=None, - smtp_encryption=None, smtp_debug=False, context=None): + smtp_encryption=None, smtp_debug=False): logger.info("Sending email to %s copy %s with subject %s", message.get('To'), message.get('Cc'), message.get('Subject')) return super(IrMailServer, self).send_email( - cr, uid, message, mail_server_id=mail_server_id, + message, mail_server_id=mail_server_id, smtp_server=smtp_server, smtp_port=smtp_port, smtp_user=smtp_user, smtp_password=smtp_password, - smtp_encryption=smtp_encryption, smtp_debug=smtp_debug, - context=context) + smtp_encryption=smtp_encryption, smtp_debug=smtp_debug) diff --git a/base_usability/misc.py b/base_usability/misc.py index 557b02a..da6960e 100644 --- a/base_usability/misc.py +++ b/base_usability/misc.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2016 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import models, fields class BaseLanguageExport(models.TransientModel): diff --git a/base_usability/module_view.xml b/base_usability/module_view.xml index 41a8cc5..e55dbb6 100644 --- a/base_usability/module_view.xml +++ b/base_usability/module_view.xml @@ -1,27 +1,24 @@ - - + - - ir.module.module - - - - - - - + + ir.module.module + + + + + + + - - ir.module.module - {} - + + {} + - - + diff --git a/base_usability/partner.py b/base_usability/partner.py index 3d8cfcb..d5fe3d6 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -1,31 +1,16 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from odoo import models, fields, api -class Partner(models.Model): +class ResPartner(models.Model): _inherit = 'res.partner' + # track_visibility is handled in the 'mail' module, and base_usability + # doesn't depend on 'mail', but that doesn't hurt, it will just be + # ignored if mail is not installed name = fields.Char(track_visibility='onchange') parent_id = fields.Many2one(track_visibility='onchange') ref = fields.Char(track_visibility='onchange') @@ -43,20 +28,26 @@ class Partner(models.Model): country_id = fields.Many2one(track_visibility='onchange') email = fields.Char(track_visibility='onchange') is_company = fields.Boolean(track_visibility='onchange') - use_parent_address = fields.Boolean(track_visibility='onchange') active = fields.Boolean(track_visibility='onchange') # For reports name_title = fields.Char( compute='_compute_name_title', string='Name with Title') - @api.one - @api.depends('name', 'title', 'is_company') + @api.multi + @api.depends('name', 'title') def _compute_name_title(self): - name_title = self.name - if self.title: - title = self.title.shortcut or self.title - if self.is_company: - name_title = ' '.join([name_title, title]) - else: + for partner in self: + name_title = partner.name + if partner.title and not partner.is_company: + title = partner.title.shortcut or partner.title name_title = ' '.join([title, name_title]) - self.name_title = name_title + partner.name_title = name_title + + @api.multi + def _display_address(self, without_company=False): + '''Remove empty lines''' + res = super(ResPartner, self)._display_address( + without_company=without_company) + while "\n\n" in res: + res = res.replace('\n\n', '\n') + return res diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index 166adf1..b05f8f8 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -1,32 +1,21 @@ - - + base_usability.title.on.partner.form res.partner - - - - - - {'readonly': [('parent_id', '!=', False)]} - - + width: 650px; - - width: 600px; - @@ -38,11 +27,7 @@ - - {'readonly': [('parent_id', '!=', False)]} - - - + diff --git a/base_usability/security/group.xml b/base_usability/security/group.xml index 8572291..bb84ffa 100644 --- a/base_usability/security/group.xml +++ b/base_usability/security/group.xml @@ -5,8 +5,7 @@ --> - - + Nobody (used to hide native menus) - - + diff --git a/base_usability/security/ir.model.access.csv b/base_usability/security/ir.model.access.csv index 48ea11a..947087d 100644 --- a/base_usability/security/ir.model.access.csv +++ b/base_usability/security/ir.model.access.csv @@ -2,3 +2,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink base.access_res_country_group_user,Full access on res.country to Settings group,base.model_res_country,base.group_system,1,1,1,1 base.access_res_country_state_group_user,Full access on res.country.state to Settings group,base.model_res_country_state,base.group_system,1,1,1,1 base.access_res_country_group_group_user,Full access on res.country.group to Settings group,base.model_res_country_group,base.group_system,1,1,1,1 +base.access_res_partner_title_group_user,Full access on res.partner.title,base.model_res_partner_title,base.group_system,1,1,1,1 diff --git a/base_usability/translation_view.xml b/base_usability/translation_view.xml deleted file mode 100644 index 026d59d..0000000 --- a/base_usability/translation_view.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - base_usability.state.translation.tree - ir.translation - - - - - - - - - - diff --git a/sale_stock_usability/__manifest__.py b/sale_stock_usability/__manifest__.py index b6e8440..59d51f9 100644 --- a/sale_stock_usability/__manifest__.py +++ b/sale_stock_usability/__manifest__.py @@ -1,24 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Sale Stock Usability module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2015-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { @@ -42,5 +25,5 @@ This module has been written by Alexis de Lattre from Akretion -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields @@ -28,25 +11,3 @@ class SaleOrder(models.Model): warehouse_id = fields.Many2one(track_visibility='onchange') incoterm = fields.Many2one(track_visibility='onchange') - - -class SaleOrderLine(models.Model): - _inherit = 'sale.order.line' - - # The sale_stock module defines the field product_tmpl_id as related - # field without readonly=True, which causes some access right issues - # when you change the product on a sale.order.line and you don't have - # write access on product.product - product_tmpl_id = fields.Many2one( - 'product.template', related='product_id.product_tmpl_id', - string='Product Template', readonly=True) - - -class ProcurementGroup(models.Model): - _inherit = 'procurement.group' - - sale_ids = fields.One2many( - 'sale.order', 'procurement_group_id', string='Sale Orders', - readonly=True) - picking_ids = fields.One2many( - 'stock.picking', 'group_id', string='Pickings', readonly=True) diff --git a/sale_stock_usability/sale_stock_view.xml b/sale_stock_usability/sale_stock_view.xml index 3930596..2f9f3ca 100644 --- a/sale_stock_usability/sale_stock_view.xml +++ b/sale_stock_usability/sale_stock_view.xml @@ -1,26 +1,14 @@ - - - - - - sale_stock_usability.picking.search - stock.picking - - - - [('invoice_state', '=', '2binvoiced'), ('state', '=', 'done')] - - - + + - - - sale_stock_usability.procurement.group.form - procurement.group - - - - - - - - - - - - - - - + diff --git a/sale_usability/__init__.py b/sale_usability/__init__.py index 581371f..78a9604 100644 --- a/sale_usability/__init__.py +++ b/sale_usability/__init__.py @@ -1,4 +1,3 @@ # -*- coding: utf-8 -*- from . import sale -from . import account_invoice diff --git a/sale_usability/__manifest__.py b/sale_usability/__manifest__.py index d430f7e..6e38faa 100644 --- a/sale_usability/__manifest__.py +++ b/sale_usability/__manifest__.py @@ -1,25 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Sale Usability module for Odoo -# Copyright (C) 2014-2016 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - +# © 2014-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Sale Usability', @@ -44,5 +26,5 @@ Please contact Alexis de Lattre from Akretion for 'data': [ 'sale_view.xml', ], - 'installable': False, + 'installable': True, } diff --git a/sale_usability/account_invoice.py b/sale_usability/account_invoice.py deleted file mode 100644 index 3f11b0e..0000000 --- a/sale_usability/account_invoice.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Sale Usability Extension module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - -from openerp import models, fields - - -class AccountInvoiceLine(models.Model): - _inherit = 'account.invoice.line' - - # reverse of the native M2M invoice_lines field on sale.order.line - sale_line_ids = fields.Many2many( - 'sale.order.line', 'sale_order_line_invoice_rel', 'invoice_id', - 'order_line_id', 'Sale Order Lines', readonly=True) diff --git a/sale_usability/sale.py b/sale_usability/sale.py index 4c5e82e..dcf68fd 100644 --- a/sale_usability/sale.py +++ b/sale_usability/sale.py @@ -1,32 +1,13 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Sale Usability Extension module for Odoo +# -*- coding: utf-8 -*- # Copyright (C) 2015 Akretion (http://www.akretion.com) # @author Alexis de Lattre -# -# 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 . -# -############################################################################## -from openerp import models, fields +from odoo import models, fields class SaleOrder(models.Model): _inherit = 'sale.order' - state = fields.Selection(track_visibility='onchange') date_order = fields.Datetime(track_visibility='onchange') date_confirm = fields.Date(track_visibility='onchange') client_order_ref = fields.Char(track_visibility='onchange') @@ -34,7 +15,13 @@ class SaleOrder(models.Model): partner_shipping_id = fields.Many2one(track_visibility='onchange') partner_invoice_id = fields.Many2one(track_visibility='onchange') pricelist_id = fields.Many2one(track_visibility='onchange') - order_policy = fields.Selection(track_visibility='onchange') - payment_term = fields.Many2one(track_visibility='onchange') - fiscal_position = fields.Many2one(track_visibility='onchange') - user_id = fields.Many2one(track_visibility='onchange') + payment_term_id = fields.Many2one(track_visibility='onchange') + fiscal_position_id = fields.Many2one(track_visibility='onchange') + + +class ProcurementGroup(models.Model): + _inherit = 'procurement.group' + + sale_ids = fields.One2many( + 'sale.order', 'procurement_group_id', string='Sale Orders', + readonly=True) diff --git a/sale_usability/sale_view.xml b/sale_usability/sale_view.xml index cb0fa20..04af21e 100644 --- a/sale_usability/sale_view.xml +++ b/sale_usability/sale_view.xml @@ -1,12 +1,11 @@ - - + usability.sale.order.form @@ -18,11 +17,7 @@ - - - - + selection @@ -34,10 +29,7 @@ - - - - + @@ -48,10 +40,7 @@ - - - - + 1 @@ -62,7 +51,16 @@ - + + usability.sale.order.search + sale.order + + + + + + + procurement_usability.procurement.order.form @@ -75,5 +73,17 @@ - - + + sale_usability.procurement.group.form + procurement.group + + + + + + + + + + + diff --git a/stock_usability/__manifest__.py b/stock_usability/__manifest__.py index a5a3f1e..c56ed84 100644 --- a/stock_usability/__manifest__.py +++ b/stock_usability/__manifest__.py @@ -1,24 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Stock Usability module for Odoo -# Copyright (C) 2014-2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2014-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { @@ -48,5 +31,5 @@ This module has been written by Alexis de Lattre from Akretion -# -# 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 . -# -############################################################################## +# © 2014-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api -import openerp.addons.decimal_precision as dp +from odoo import models, fields, api +import odoo.addons.decimal_precision as dp import logging logger = logging.getLogger(__name__) @@ -121,3 +104,10 @@ class StockIncoterms(models.Model): for inco in self: res.append((inco.id, u'[%s] %s' % (inco.code, inco.name))) return res + + +class ProcurementGroup(models.Model): + _inherit = 'procurement.group' + + picking_ids = fields.One2many( + 'stock.picking', 'group_id', string='Pickings', readonly=True) diff --git a/stock_usability/stock_view.xml b/stock_usability/stock_view.xml index 1dda15b..0184e9a 100644 --- a/stock_usability/stock_view.xml +++ b/stock_usability/stock_view.xml @@ -284,5 +284,18 @@ in the quantities for his reception --> + + stock_usability.procurement.group.form + procurement.group + + + + + + + + + +