Skip to content

Commit

Permalink
[MIG] account_invoice_prices_update: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rov-adhoc committed Dec 4, 2023
1 parent e21efc3 commit e9cd33a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions account_invoice_prices_update/__manifest__.py
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Account Invoice Prices Update',
'version': "16.0.1.0.0",
'version': "17.0.1.0.0",
'author': 'ADHOC SA',
'license': 'AGPL-3',
'category': 'Accounting & Finance',
Expand All @@ -32,5 +32,5 @@
'views/account_move_views.xml',
'security/ir.model.access.csv',
],
'installable': False,
'installable': True,
}
11 changes: 8 additions & 3 deletions account_invoice_prices_update/views/account_move_views.xml
Expand Up @@ -5,9 +5,14 @@
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<button name="button_draft" position="after">
<button name="%(account_invoice_prices_update.action_update_prices_list)d" string="Update Pricelist and Prices" type="action" groups="account.group_account_invoice" attrs="{'invisible':['|', ('state', '!=', 'draft'), ('move_type', 'not in', ('out_invoice', 'out_refund'))]}" context="{'default_type': 'sale'}"/>
</button>
<button name="button_draft" position="after">
<button name="%(account_invoice_prices_update.action_update_prices_list)d"
string="Update Pricelist and Prices"
type="action"
groups="account.group_account_invoice"
invisible="state != 'draft' or move_type not in ('out_invoice', 'out_refund')"
context="{'default_type': 'sale'}"/>
</button>
</field>
</record>

Expand Down
Expand Up @@ -79,7 +79,7 @@ def _get_price_discount(self, pricelist, invoice_line):
qty,
uom,
date,
target_currency=invoice_line.currency_id,
currency=invoice_line.currency_id,
)
price_unit = max(base_price, final_price)
return price_unit, self._calculate_discount(base_price, final_price)

0 comments on commit e9cd33a

Please sign in to comment.