diff --git a/account_aged_balance_from_partner/__init__.py b/account_aged_balance_from_partner/__init__.py new file mode 100644 index 0000000..61cf8b2 --- /dev/null +++ b/account_aged_balance_from_partner/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import partner diff --git a/account_aged_balance_from_partner/__manifest__.py b/account_aged_balance_from_partner/__manifest__.py new file mode 100644 index 0000000..9dead52 --- /dev/null +++ b/account_aged_balance_from_partner/__manifest__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Copyright 2015-2018 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Aged Partner Balance from Partner', + 'version': '10.0.0.1.0', + 'category': 'Accounting', + 'license': 'AGPL-3', + 'summary': 'Direct access to the aged partner balance report from the partner form', + 'description': """ +Aged Partner Balance from Partner +================================= + +This module adds a button on the partner form view (the icon on the button is a banknote) to easily open the detailed aged partner balance of the partner in PDF format. + +This module has been written by Alexis de Lattre from Akretion . + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['account_financial_report_qweb'], + 'data': ['partner_view.xml'], + 'installable': True, +} diff --git a/account_aged_balance_from_partner/partner.py b/account_aged_balance_from_partner/partner.py new file mode 100644 index 0000000..74f248c --- /dev/null +++ b/account_aged_balance_from_partner/partner.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2015-2018 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import models, fields, api + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + @api.depends('credit', 'debit') + def _compute_balance(self): + for partner in self: + partner.balance = partner.credit - partner.debit + + # The field 'currency_id' defined in the account module + # is a computed field that gets the company currency + balance = fields.Monetary( + compute='_compute_balance', readonly=True, + string="Account Balance") + + def open_aged_open_invoices_report(self): + wiz = self.env['aged.partner.balance.wizard'].create({ + 'show_move_line_details': True, + 'partner_ids': [(6, 0, self.ids)], + }) + action = wiz.button_export_pdf() + return action diff --git a/account_aged_balance_from_partner/partner_view.xml b/account_aged_balance_from_partner/partner_view.xml new file mode 100644 index 0000000..1bf6534 --- /dev/null +++ b/account_aged_balance_from_partner/partner_view.xml @@ -0,0 +1,31 @@ + + + + + + + + account.balance.button.partner.form + res.partner + + + + + + + + + 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') + + + diff --git a/account_usability/account_view.xml b/account_usability/account_view.xml index 4ba3700..56db998 100644 --- a/account_usability/account_view.xml +++ b/account_usability/account_view.xml @@ -252,6 +252,12 @@ module --> + + + + + + 200 @@ -287,6 +293,9 @@ module --> + + Unreconciled or Partially Reconciled + Name or Reference @@ -421,6 +430,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 + + + + diff --git a/account_usability/partner_view.xml b/account_usability/partner_view.xml index 13e2f27..c55f836 100644 --- a/account_usability/partner_view.xml +++ b/account_usability/partner_view.xml @@ -16,6 +16,9 @@ selection + + account.group_account_user + 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 + 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 - - - - - - - - - - - - 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 @@ - + diff --git a/purchase_usability/purchase_view.xml b/purchase_usability/purchase_view.xml index 8467a19..d94e373 100644 --- a/purchase_usability/purchase_view.xml +++ b/purchase_usability/purchase_view.xml @@ -180,4 +180,42 @@ + + + Purchase Order Lines + purchase.order.line + + [('product_id','in',active_ids), ('state', 'in', ['purchase', 'done'])] + {} + + + + product.product.purchase.button.inherit + product.product + + + +
+ +
+
+
+ + + purchase_usability.product.template.form + product.template + + + + + + + + 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 @@ - - + + 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 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 84c4d83..4a001e1 100644 --- a/stock_usability/stock_view.xml +++ b/stock_usability/stock_view.xml @@ -114,14 +114,14 @@ stock.move - + attrs="{'invisible': [('reserved_quant_ids', '=', [])]}"/> + + + + @@ -133,8 +133,10 @@ + + @@ -147,6 +149,11 @@ stock.move + +