diff --git a/purchase_usability_akretion/__manifest__.py b/purchase_usability_akretion/__manifest__.py index f5b53f2..4859e38 100644 --- a/purchase_usability_akretion/__manifest__.py +++ b/purchase_usability_akretion/__manifest__.py @@ -1,20 +1,20 @@ -# Copyright 2014-2022 Akretion (http://www.akretion.com) +# Copyright 2014-2024 Akretion (https://www.akretion.com) # @author Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Purchase Usability', - 'version': '16.0.1.0.0', + 'version': '18.0.1.0.0', 'category': 'Purchases', 'license': 'AGPL-3', 'summary': 'Usability improvements on purchase module', 'author': 'Akretion', - 'website': 'http://www.akretion.com', + 'website': 'https://github.com/akretion/odoo-usability', 'depends': ['purchase'], 'data': [ 'views/purchase_order.xml', 'views/purchase_report.xml', 'views/account_move.xml', ], - 'installable': False, + 'installable': True, } diff --git a/purchase_usability_akretion/models/account_move.py b/purchase_usability_akretion/models/account_move.py index 55cc1c8..e6f7a0c 100644 --- a/purchase_usability_akretion/models/account_move.py +++ b/purchase_usability_akretion/models/account_move.py @@ -1,4 +1,4 @@ -# Copyright 2022 Akretion France (http://www.akretion.com/) +# Copyright 2022-2024 Akretion France (https://www.akretion.com/) # @author: Alexis de Lattre # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). @@ -16,6 +16,6 @@ class AccountMove(models.Model): lines = self.env['account.move.line'].search([ ('move_id', '=', self.id), ('quantity', '=', 0), - ('display_type', '=', False), + ('display_type', '=', 'product'), ]) lines.unlink() diff --git a/purchase_usability_akretion/models/product_template.py b/purchase_usability_akretion/models/product_template.py index 1d80428..2c0b536 100644 --- a/purchase_usability_akretion/models/product_template.py +++ b/purchase_usability_akretion/models/product_template.py @@ -1,4 +1,4 @@ -# Copyright 2016-2022 Akretion France +# Copyright 2016-2024 Akretion France (https://www.akretion.com/) # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/purchase_usability_akretion/models/purchase_order.py b/purchase_usability_akretion/models/purchase_order.py index b46e84a..65c03e4 100644 --- a/purchase_usability_akretion/models/purchase_order.py +++ b/purchase_usability_akretion/models/purchase_order.py @@ -24,19 +24,17 @@ class PurchaseOrder(models.Model): for order in self: order.delivery_partner_id = order.dest_address_id - # Re-write native name_get() to use amount_untaxed instead of amount_total - @api.depends('name', 'partner_ref', 'amount_untaxed') - def name_get(self): - result = [] + # Re-write native _compute_display_name to use amount_untaxed instead of amount_total + @api.depends('name', 'partner_ref', 'amount_total', 'currency_id') + @api.depends_context('show_total_amount') + def _compute_display_name(self): for po in self: name = po.name if po.partner_ref: name += ' (' + po.partner_ref + ')' if self.env.context.get('show_total_amount') and po.amount_untaxed: - name += ': ' + format_amount( - self.env, po.amount_untaxed, po.currency_id) - result.append((po.id, name)) - return result + name += ': ' + formatLang(self.env, po.amount_untaxed, currency_obj=po.currency_id) + po.display_name = name # for report def py3o_lines_layout(self): diff --git a/purchase_usability_akretion/models/res_partner.py b/purchase_usability_akretion/models/res_partner.py index 932ad1e..49cd6dc 100644 --- a/purchase_usability_akretion/models/res_partner.py +++ b/purchase_usability_akretion/models/res_partner.py @@ -1,4 +1,4 @@ -# Copyright 2017-2022 Akretion France +# Copyright 2017-2024 Akretion France (https://www.akretion.com/) # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/purchase_usability_akretion/views/account_move.xml b/purchase_usability_akretion/views/account_move.xml index e0ff671..a9bb477 100644 --- a/purchase_usability_akretion/views/account_move.xml +++ b/purchase_usability_akretion/views/account_move.xml @@ -1,12 +1,13 @@ + diff --git a/purchase_usability_akretion/views/purchase_order.xml b/purchase_usability_akretion/views/purchase_order.xml index 49733e6..b91915f 100644 --- a/purchase_usability_akretion/views/purchase_order.xml +++ b/purchase_usability_akretion/views/purchase_order.xml @@ -13,16 +13,13 @@ purchase.order - - - selection - - + diff --git a/purchase_usability_akretion/views/purchase_report.xml b/purchase_usability_akretion/views/purchase_report.xml index 1bd9c63..ce20609 100644 --- a/purchase_usability_akretion/views/purchase_report.xml +++ b/purchase_usability_akretion/views/purchase_report.xml @@ -1,6 +1,6 @@ @@ -8,7 +8,7 @@ - pivot,graph,tree + pivot,graph,list