From ffd6a409ccb7bf0b80bee998f11395053c21af3c Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 5 Jun 2018 20:11:26 +0200 Subject: [PATCH 01/14] Add tree/form view + menu entry for account.tax.group --- account_usability/account_view.xml | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/account_usability/account_view.xml b/account_usability/account_view.xml index 4ba3700..84c60bc 100644 --- a/account_usability/account_view.xml +++ b/account_usability/account_view.xml @@ -421,6 +421,40 @@ module --> + + + + usability.account.tax.group.form + account.tax.group + +
+ + + + +
+
+
+ + + usability.account.tax.group.tree + account.tax.group + + + + + + + + + + Tax Groups + account.tax.group + tree,form + + + + From 7908943645d61c48659b49b8202faa10ef27091e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 7 Jun 2018 16:56:48 +0200 Subject: [PATCH 02/14] Port stock_picking_type_default_partner to v10 --- .../__manifest__.py | 37 +++-------- stock_picking_type_default_partner/stock.py | 66 ++++++------------- .../stock_view.xml | 15 ++--- 3 files changed, 36 insertions(+), 82 deletions(-) diff --git a/stock_picking_type_default_partner/__manifest__.py b/stock_picking_type_default_partner/__manifest__.py index 8403faf..bc6e7f8 100644 --- a/stock_picking_type_default_partner/__manifest__.py +++ b/stock_picking_type_default_partner/__manifest__.py @@ -1,45 +1,26 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Stock Picking Type Default Partner module for Odoo -# Copyright (C) 2014 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 -*- +# Copyright (C) 2014-2018 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Stock Picking Type Default Partner', - 'version': '0.1', - 'category': 'Inventory, Logistic, Storage', + 'version': '10.0.1.0.0', + 'category': 'Inventory, Logistics, Warehousing', 'license': 'AGPL-3', 'summary': 'Adds a default partner on types of operation', 'description': """ Stock Picking Type Default Partner ================================== -This module adds a new field on the Types of Operation (stock.picking.type) : *Default Partner*. +This module adds a new field on the Types of Operation (stock.picking.type) : *Default Partner*. This is useful for multi-site companies that create inter-site Type of Operations: all the operations that use this Type of Operation should have the same destination partner. This module has been written by Alexis de Lattre from Akretion . """, 'author': 'Akretion', 'website': 'http://www.akretion.com', 'depends': ['stock'], - 'data': [ - 'stock_view.xml' - ], - 'installable': False, + 'data': ['stock_view.xml'], + 'installable': True, } diff --git a/stock_picking_type_default_partner/stock.py b/stock_picking_type_default_partner/stock.py index 6a79763..fcce416 100644 --- a/stock_picking_type_default_partner/stock.py +++ b/stock_picking_type_default_partner/stock.py @@ -1,57 +1,31 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Stock Picking Type Default Partner module for Odoo -# Copyright (C) 2014 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 . -# -############################################################################## - -# For an unknown reasons, it doesn't work when using the new API -# with this module it breaks in an SQL query trying to select the -# "picking_type_code" on stock.picking although it is a related field -# store=False So I keep it with the old API for the moment -from openerp.osv import orm, fields +# -*- coding: utf-8 -*- +# Copyright 2014-2018 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -class StockPickingType(orm.Model): +from odoo import models, fields, api + + +class StockPickingType(models.Model): _inherit = 'stock.picking.type' - _columns = { - 'default_partner_id': fields.many2one( - 'res.partner', 'Default Partner', ondelete='restrict', - help="If set, it will be the default partner on this type " - "of pickings."), - } + default_partner_id = fields.Many2one( + 'res.partner', string='Default Partner', ondelete='restrict', + help="If set, it will be the default partner on this type of " + "pickings.") -class StockPicking(orm.Model): +class StockPicking(models.Model): _inherit = 'stock.picking' - def _default_partner_id(self, cr, uid, context=None): - if context is None: - context = {} - if context.get('default_picking_type_id'): - picktype = self.pool['stock.picking.type'].browse( - cr, uid, context.get('default_picking_type_id'), - context=context) + @api.model + def _default_partner_id(self): + if self._context.get('default_picking_type_id'): + picktype = self.env['stock.picking.type'].browse( + self._context.get('default_picking_type_id')) if picktype.default_partner_id: - return picktype.default_partner_id.id + return picktype.default_partner_id return False - _defaults = { - 'partner_id': _default_partner_id, - } + partner_id = fields.Many2one(default=_default_partner_id) diff --git a/stock_picking_type_default_partner/stock_view.xml b/stock_picking_type_default_partner/stock_view.xml index bef01d5..f58e139 100644 --- a/stock_picking_type_default_partner/stock_view.xml +++ b/stock_picking_type_default_partner/stock_view.xml @@ -1,13 +1,12 @@ - - - + + default.partner.stock.picking.type.form @@ -20,5 +19,5 @@ - - + + From 8b3205cc3540b95dc7b7472cc2480b0027a2eae7 Mon Sep 17 00:00:00 2001 From: Chafique Date: Mon, 11 Jun 2018 10:41:36 +0200 Subject: [PATCH 03/14] [MIG] [10.0] purchase_hide_report_print_menu --- purchase_hide_report_print_menu/__manifest__.py | 4 ++-- purchase_hide_report_print_menu/purchase.py | 2 +- purchase_hide_report_print_menu/purchase_view.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/purchase_hide_report_print_menu/__manifest__.py b/purchase_hide_report_print_menu/__manifest__.py index e747d0f..2fffa51 100644 --- a/purchase_hide_report_print_menu/__manifest__.py +++ b/purchase_hide_report_print_menu/__manifest__.py @@ -6,13 +6,13 @@ 'name': 'Purchase Hide Report Print Menu', 'summary': "Hide print report 'Request for Quotation' " "in purchase order menu", - 'version': '8.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Purchase Management', 'website': 'http://akretion.com', 'author': 'Akretion, Odoo Community Association (OCA)', 'license': 'AGPL-3', 'application': False, - 'installable': False, + 'installable': True, 'depends': [ 'purchase', ], diff --git a/purchase_hide_report_print_menu/purchase.py b/purchase_hide_report_print_menu/purchase.py index 1cce52e..4caeaf0 100644 --- a/purchase_hide_report_print_menu/purchase.py +++ b/purchase_hide_report_print_menu/purchase.py @@ -2,7 +2,7 @@ # © 2016 Chafique DELLI @ Akretion # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, api +from odoo import models, api class PurchaseOrder(models.Model): diff --git a/purchase_hide_report_print_menu/purchase_view.xml b/purchase_hide_report_print_menu/purchase_view.xml index 5ddc13a..950c213 100644 --- a/purchase_hide_report_print_menu/purchase_view.xml +++ b/purchase_hide_report_print_menu/purchase_view.xml @@ -1,6 +1,6 @@ - + @@ -8,4 +8,4 @@ - + From c02f539f8fcaf1e7fd542a99492e672d9d561554 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 13 Jun 2018 01:15:19 +0200 Subject: [PATCH 04/14] Add and improve views for usability purposes --- purchase_usability/purchase_view.xml | 28 ++++++++++++++++++++++++++++ stock_usability/stock_view.xml | 11 +++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/purchase_usability/purchase_view.xml b/purchase_usability/purchase_view.xml index 8467a19..567b50c 100644 --- a/purchase_usability/purchase_view.xml +++ b/purchase_usability/purchase_view.xml @@ -180,4 +180,32 @@ + + + Purchase Order Lines + purchase.order.line + + [('product_id','in',active_ids), ('state', 'in', ['purchase', 'done'])] + {} + + + + product.product.purchase.button.inherit + product.product + + + +
+ +
+
+
+ + diff --git a/stock_usability/stock_view.xml b/stock_usability/stock_view.xml index 84c4d83..50a0d16 100644 --- a/stock_usability/stock_view.xml +++ b/stock_usability/stock_view.xml @@ -122,6 +122,9 @@ states="confirmed,assigned"/> --> + + + @@ -133,8 +136,10 @@ + + @@ -161,7 +166,9 @@ + + @@ -311,14 +318,14 @@ should be able to access it. So I add a menu entry under Inventory Control. --> but it forces a group by on products that you can't remove So I create another "regular" Quants" menu entry --> - Quants + Quants List stock.quant tree,form,pivot {'search_default_internal_loc': 1} From 6fa8464ab713009daa70d3fc75b39bbd90e57fca Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 13 Jun 2018 17:59:37 +0200 Subject: [PATCH 05/14] Add unreserve buttons on moves + log in chatter --- stock_usability/stock.py | 23 +++++++++++++++++++++++ stock_usability/stock_view.xml | 20 ++++++++++++++------ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/stock_usability/stock.py b/stock_usability/stock.py index ea2f3cb..490745f 100644 --- a/stock_usability/stock.py +++ b/stock_usability/stock.py @@ -31,6 +31,13 @@ class StockPicking(models.Model): pick.message_post(_("Using Force Availability!")) return res + @api.multi + def do_unreserve(self): + res = super(StockPicking, self).do_unreserve() + for pick in self: + pick.message_post(_("Picking unreserved.")) + return res + class StockLocation(models.Model): _inherit = 'stock.location' @@ -115,6 +122,22 @@ class StockMove(models.Model): res.append((line.id, name)) return res + def button_do_unreserve(self): + for move in self: + move.do_unreserve() + if move.picking_id: + product = move.product_id + self.picking_id.message_post(_( + "Product %s qty %s %s unreserved") + % (product.id, product.display_name, + move.product_qty, move.product_id.uom_id.name)) + ops = self.env['stock.pack.operation'] + for smol in move.linked_move_operation_ids: + if smol.operation_id: + ops += smol.operation_id + ops.unlink() + class StockIncoterms(models.Model): _inherit = 'stock.incoterms' diff --git a/stock_usability/stock_view.xml b/stock_usability/stock_view.xml index 50a0d16..3e5bb3a 100644 --- a/stock_usability/stock_view.xml +++ b/stock_usability/stock_view.xml @@ -114,14 +114,11 @@ stock.move - + @@ -152,6 +149,11 @@ stock.move + + + + + + + + diff --git a/partner_aged_open_invoices/__init__.py b/partner_aged_open_invoices/__init__.py deleted file mode 100644 index 84d775d..0000000 --- a/partner_aged_open_invoices/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- encoding: utf-8 -*- - -from . import partner diff --git a/partner_aged_open_invoices/__manifest__.py b/partner_aged_open_invoices/__manifest__.py deleted file mode 100644 index 51f493d..0000000 --- a/partner_aged_open_invoices/__manifest__.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Partner Aged Open Invoices module for Odoo -# Copyright (C) 2015-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 . -# -############################################################################## - - -{ - 'name': 'Partner Aged Open Invoices', - 'version': '10.0.0.1.0', - 'category': 'Accounting & Finance', - 'license': 'AGPL-3', - 'summary': 'Direct access to the aged open invoice report from the partner form', - 'description': """ -Partner Aged Open Invoices -========================== - -This module adds a button on the partner form view (the icon on the button is a banknote) to easily open the aged open invoices report of the partner. - -It requires the updated version of the module **account_financial_report_webkit** that has the aged open invoice report ; you can find it in this pull request https://github.com/OCA/account-financial-reporting/pull/102 - -This module has been written by Alexis de Lattre from Akretion . - """, - 'author': 'Akretion', - 'website': 'http://www.akretion.com', - 'depends': ['account_financial_report_webkit'], - 'data': ['partner_view.xml'], - 'installable': False, -} diff --git a/partner_aged_open_invoices/partner.py b/partner_aged_open_invoices/partner.py deleted file mode 100644 index 4010d86..0000000 --- a/partner_aged_open_invoices/partner.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Partner Aged Open Invoices 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, api -import openerp.addons.decimal_precision as dp - - -class ResPartner(models.Model): - _inherit = 'res.partner' - - @api.one - @api.depends('credit', 'debit') - def _compute_balance(self): - self.balance = self.credit - self.debit - - balance = fields.Float( - compute='_compute_balance', readonly=True, - digits=dp.get_precision('Account'), string="Account Balance") - - @api.multi - def open_aged_open_invoices_report(self): - aoiwo = self.env['aged.open.invoices.webkit'] - afo = self.env['account.fiscalyear'] - # Force 'date_from' to the first day of the company's life - # in order to get the full picture of the partner's account - # (we could also do that via a filter by period, but, in this case, - # account_financial_report_webkit doesn't accept "until_date = today" ; - # until_date has to be the end date of the last period - fy_years = afo.search([], order='date_start') - date_from = fy_years[0].date_start - fy_id = aoiwo._get_fiscalyear() - filter_change = aoiwo.onchange_filter( - filter='filter_date', fiscalyear_id=fy_id) - vals = { - 'fiscalyear_id': fy_id, - 'filter': 'filter_date', - 'partner_ids': [(6, 0, [self.commercial_partner_id.id])], - 'target_move': 'all', - } - vals.update(filter_change['value']) - vals['date_from'] = date_from - wizard = aoiwo.create(vals) - data = {'form': { - 'chart_account_id': wizard.chart_account_id.id, - 'filter': vals['filter'], - 'date_from': vals['date_from'], - 'date_to': vals['date_to'], - 'period_to': False, - 'fiscalyear_id': vals['fiscalyear_id'], - 'partner_ids': vals['partner_ids'][0][2], - 'target_move': vals['target_move'], - } - } - action = wizard._print_report(data) - return action diff --git a/partner_aged_open_invoices/partner_view.xml b/partner_aged_open_invoices/partner_view.xml deleted file mode 100644 index a270328..0000000 --- a/partner_aged_open_invoices/partner_view.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - account.balance.button.partner.form - res.partner - - - - - - - - - - - - From 8416216a77a42803f18027a141aadc95cf0b673e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 19 Jun 2018 15:16:32 +0200 Subject: [PATCH 12/14] account_usability: don't attach PDF upon invoice report generation on supplier invoices/refunds --- account_usability/__manifest__.py | 1 + account_usability/account_report.xml | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 account_usability/account_report.xml diff --git a/account_usability/__manifest__.py b/account_usability/__manifest__.py index 0a3470c..a422df3 100644 --- a/account_usability/__manifest__.py +++ b/account_usability/__manifest__.py @@ -36,6 +36,7 @@ This module has been written by Alexis de Lattre from Akretion + + + + + + + (object.type in ('out_invoice', 'out_refund')) and (object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf') + + + From cc3b9d73aeea1fdbea459c7906597e595d5197cd Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 19 Jun 2018 22:38:22 +0200 Subject: [PATCH 13/14] Remove write/create on products to stock user --- purchase_usability/purchase_view.xml | 10 ++++++++++ stock_usability/security/ir.model.access.csv | 2 ++ 2 files changed, 12 insertions(+) diff --git a/purchase_usability/purchase_view.xml b/purchase_usability/purchase_view.xml index 567b50c..d94e373 100644 --- a/purchase_usability/purchase_view.xml +++ b/purchase_usability/purchase_view.xml @@ -207,5 +207,15 @@ In v8, it was present on both, so I put the cart button on the product.product f + + purchase_usability.product.template.form + product.template + + + + + + + diff --git a/stock_usability/security/ir.model.access.csv b/stock_usability/security/ir.model.access.csv index 9316def..d340b15 100644 --- a/stock_usability/security/ir.model.access.csv +++ b/stock_usability/security/ir.model.access.csv @@ -3,3 +3,5 @@ access_procurement_scheduler_log_full,Full access on procurement.scheduler.log t access_procurement_scheduler_log_user,Read/Create procurement.scheduler.log to Stock user,model_procurement_scheduler_log,stock.group_stock_user,1,0,1,0 access_procurement_scheduler_log_read,Read access on procurement.scheduler.log to Employee,model_procurement_scheduler_log,base.group_user,1,0,0,0 access_stock_warehouse_orderpoint_employee,Read access on stock.warehouse.orderpoint to employee (needed to open product form view with employee-only group),stock.model_stock_warehouse_orderpoint,base.group_user,1,0,0,0 +stock.access_product_product_stock_user,product_product_stock_user,product.model_product_product,stock.group_stock_user,1,0,0,0 +stock.access_product_template_stock_user,product.template stock user,product.model_product_template,stock.group_stock_user,1,0,0,0 From 8f555c88ce0d51ac22bf30151f39c7a7cad69361 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 20 Jun 2018 23:45:09 +0200 Subject: [PATCH 14/14] Add widget="email" on email of contacts --- base_usability/partner_view.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index 91951cf..da409b9 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -16,6 +16,9 @@ width: 650px; + + email +