[MIG] purchase_usability_akretion to v18
This commit is contained in:
@@ -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 <alexis.delattre@akretion.com>
|
||||
# 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()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2016-2022 Akretion France
|
||||
# Copyright 2016-2024 Akretion France (https://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2022 Akretion France
|
||||
# Copyright 2017-2024 Akretion France (https://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user