From e786204d06de076f3229f698b03f90d0480e8b56 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 11 Oct 2016 15:27:34 +0200 Subject: [PATCH] Remove modules that will be merged in ***_usability modules or that are not useful in v10 Rename some modules --- purchase_usability/__init__.py | 2 + purchase_usability/__openerp__.py | 45 +++++++++++ purchase_usability/purchase.py | 74 +++++++++++++++++ purchase_usability/purchase_view.xml | 72 +++++++++++++++++ sale_usability/__init__.py | 4 + sale_usability/__openerp__.py | 48 +++++++++++ sale_usability/account_invoice.py | 32 ++++++++ sale_usability/i18n/fr.po | 49 ++++++++++++ .../i18n/sale_usability_extension.pot | 48 +++++++++++ sale_usability/sale.py | 40 ++++++++++ sale_usability/sale_view.xml | 79 +++++++++++++++++++ 11 files changed, 493 insertions(+) create mode 100644 purchase_usability/__init__.py create mode 100644 purchase_usability/__openerp__.py create mode 100644 purchase_usability/purchase.py create mode 100644 purchase_usability/purchase_view.xml create mode 100644 sale_usability/__init__.py create mode 100644 sale_usability/__openerp__.py create mode 100644 sale_usability/account_invoice.py create mode 100644 sale_usability/i18n/fr.po create mode 100644 sale_usability/i18n/sale_usability_extension.pot create mode 100644 sale_usability/sale.py create mode 100644 sale_usability/sale_view.xml diff --git a/purchase_usability/__init__.py b/purchase_usability/__init__.py new file mode 100644 index 0000000..4fa4d52 --- /dev/null +++ b/purchase_usability/__init__.py @@ -0,0 +1,2 @@ +# -*- encoding: utf-8 -*- +from . import purchase diff --git a/purchase_usability/__openerp__.py b/purchase_usability/__openerp__.py new file mode 100644 index 0000000..3852328 --- /dev/null +++ b/purchase_usability/__openerp__.py @@ -0,0 +1,45 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Purchase Usability module for OpenERP +# 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 . +# +############################################################################## + + +{ + 'name': 'Purchase Usability', + 'version': '0.1', + 'category': 'Purchase Management', + 'license': 'AGPL-3', + 'summary': 'Show invoices and receptions on PO', + 'description': """ +Purchase Usability Extension +============================ + +Display Invoices and Incoming Shipments on Purchase Order form view (in dedicated tabs). + +Please contact Alexis de Lattre from Akretion for any help or question about this module. + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['purchase'], + 'data': [ + 'purchase_view.xml', + ], + 'active': False, +} diff --git a/purchase_usability/purchase.py b/purchase_usability/purchase.py new file mode 100644 index 0000000..821fabb --- /dev/null +++ b/purchase_usability/purchase.py @@ -0,0 +1,74 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Purchase 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, api + + +class PurchaseOrderLine(models.Model): + _inherit = 'purchase.order.line' + _order = 'order_id, sequence, id' + + sequence = fields.Integer(string='Sequence', default=10) + + +class PurchaseOrder(models.Model): + _inherit = 'purchase.order' + + state = fields.Selection(track_visibility='onchange') + location_id = fields.Many2one(track_visibility='onchange') + picking_type_id = fields.Many2one(track_visibility='onchange') + dest_address_id = fields.Many2one(track_visibility='onchange') + pricelist_id = fields.Many2one(track_visibility='onchange') + date_approve = fields.Date(track_visibility='onchange') + validator = fields.Many2one(track_visibility='onchange') + invoice_method = fields.Selection(track_visibility='onchange') + payment_term_id = fields.Many2one(track_visibility='onchange') + fiscal_position = fields.Many2one(track_visibility='onchange') + incoterm_id = fields.Many2one(track_visibility='onchange') + partner_ref = fields.Char(track_visibility='onchange') + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + @api.one + def _purchase_stats(self): + poo = self.env['purchase.order'] + aio = self.env['account.invoice'] + try: + self.purchase_order_count = poo.search_count( + [('partner_id', 'child_of', self.id)]) + except: + pass + try: + self.supplier_invoice_count = aio.search_count([ + ('partner_id', 'child_of', self.id), + ('type', '=', 'in_invoice')]) + except: + pass + + # Fix an access right issue when accessing partner form without being + # a member of the purchase/User group + purchase_order_count = fields.Integer( + compute='_purchase_stats', string='# of Purchase Order') + supplier_invoice_count = fields.Integer( + compute='_purchase_stats', string='# Supplier Invoices') diff --git a/purchase_usability/purchase_view.xml b/purchase_usability/purchase_view.xml new file mode 100644 index 0000000..e01cc15 --- /dev/null +++ b/purchase_usability/purchase_view.xml @@ -0,0 +1,72 @@ + + + + + + + + usability.purchase.order.form + purchase.order + + 1000 + + + + + + + + + + + + Other Information + + + + + + selection + + + + + + usability.purchase.order.tree + purchase.order + + 100 + + + + + + + + + + + + usability.purchase.order.tree + purchase.order + + + + + + + + + + + + {'search_default_draft': True} + + + + diff --git a/sale_usability/__init__.py b/sale_usability/__init__.py new file mode 100644 index 0000000..581371f --- /dev/null +++ b/sale_usability/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import sale +from . import account_invoice diff --git a/sale_usability/__openerp__.py b/sale_usability/__openerp__.py new file mode 100644 index 0000000..faae3b4 --- /dev/null +++ b/sale_usability/__openerp__.py @@ -0,0 +1,48 @@ +# -*- 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 . +# +############################################################################## + + +{ + 'name': 'Sale Usability', + 'version': '0.1', + 'category': 'Sale Management', + 'license': 'AGPL-3', + 'summary': 'Show invoices on sale orders', + 'description': """ +Sale Usability Extension +======================== + +Several small usability improvements: + +* Display Invoices on Sale Order form view (in dedicated tab). +* Display currency in tree view + +Please contact Alexis de Lattre from Akretion for any help or question about this module. + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['sale'], + 'data': [ + 'sale_view.xml', + ], + 'installable': True, +} diff --git a/sale_usability/account_invoice.py b/sale_usability/account_invoice.py new file mode 100644 index 0000000..3f11b0e --- /dev/null +++ b/sale_usability/account_invoice.py @@ -0,0 +1,32 @@ +# -*- 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/i18n/fr.po b/sale_usability/i18n/fr.po new file mode 100644 index 0000000..3e46c68 --- /dev/null +++ b/sale_usability/i18n/fr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_usability_extension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-13 11:01+0000\n" +"PO-Revision-Date: 2016-07-13 13:03+0200\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"Language: fr\n" +"X-Generator: Poedit 1.8.7.1\n" + +#. module: sale_usability_extension +#: model:ir.model,name:sale_usability_extension.model_account_invoice_line +msgid "Invoice Line" +msgstr "Lignes de facture" + +#. module: sale_usability_extension +#: view:sale.order:sale_usability_extension.view_order_form +msgid "Invoices" +msgstr "Factures" + +#. module: sale_usability_extension +#: field:account.invoice.line,sale_line_ids:0 +msgid "Sale Order Lines" +msgstr "Lignes de Vente" + +#. module: sale_usability_extension +#: model:ir.model,name:sale_usability_extension.model_sale_order +msgid "Sales Order" +msgstr "Bon de commande" + +#. module: sale_usability_extension +#: view:sale.order:sale_usability_extension.view_order_tree +#: view:sale.order:sale_usability_extension.view_quotation_tree +msgid "Total Untaxed" +msgstr "Total HT" + +#. module: sale_usability_extension +#: view:sale.order:sale_usability_extension.view_order_form +msgid "selection" +msgstr "selection" diff --git a/sale_usability/i18n/sale_usability_extension.pot b/sale_usability/i18n/sale_usability_extension.pot new file mode 100644 index 0000000..cbada37 --- /dev/null +++ b/sale_usability/i18n/sale_usability_extension.pot @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_usability_extension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-13 11:01+0000\n" +"PO-Revision-Date: 2016-07-13 11:01+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: sale_usability_extension +#: model:ir.model,name:sale_usability_extension.model_account_invoice_line +msgid "Invoice Line" +msgstr "" + +#. module: sale_usability_extension +#: view:sale.order:sale_usability_extension.view_order_form +msgid "Invoices" +msgstr "" + +#. module: sale_usability_extension +#: field:account.invoice.line,sale_line_ids:0 +msgid "Sale Order Lines" +msgstr "" + +#. module: sale_usability_extension +#: model:ir.model,name:sale_usability_extension.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: sale_usability_extension +#: view:sale.order:sale_usability_extension.view_order_tree +#: view:sale.order:sale_usability_extension.view_quotation_tree +msgid "Total Untaxed" +msgstr "" + +#. module: sale_usability_extension +#: view:sale.order:sale_usability_extension.view_order_form +msgid "selection" +msgstr "" + diff --git a/sale_usability/sale.py b/sale_usability/sale.py new file mode 100644 index 0000000..4c5e82e --- /dev/null +++ b/sale_usability/sale.py @@ -0,0 +1,40 @@ +# -*- encoding: 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 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') + partner_id = fields.Many2one(track_visibility='onchange') + 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') diff --git a/sale_usability/sale_view.xml b/sale_usability/sale_view.xml new file mode 100644 index 0000000..cb0fa20 --- /dev/null +++ b/sale_usability/sale_view.xml @@ -0,0 +1,79 @@ + + + + + + + + usability.sale.order.form + sale.order + + + + + + + + + + + + selection + + + + + + usability.sale.quotation.tree + sale.order + + + + + + + + + + + + + usability.sale.order.tree + sale.order + + + + + + + + + + 1 + + + + + + + + + + + procurement_usability.procurement.order.form + procurement.order + + + + + + + + + +