Skip to content

Commit

Permalink
[FIX] sale_ux: action_update_prices names
Browse files Browse the repository at this point in the history
  • Loading branch information
jok-adhoc committed Feb 16, 2023
1 parent 854c16e commit a4c3ba3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion sale_ux/models/sale_order.py
Expand Up @@ -106,7 +106,10 @@ def _get_update_prices_lines(self):
lines_to_not_update_ids = self._context.get('lines_to_not_update_ids', [])
return lines.filtered(lambda l: l.id not in lines_to_not_update_ids)

def update_prices(self):
def action_update_prices(self):
# avoiding execution for empty records
if not self:
return
# for compatibility with product_pack module
pack_installed = 'pack_parent_line_id' in self.order_line._fields
if pack_installed:
Expand Down
6 changes: 3 additions & 3 deletions sale_ux/views/sale_order_views.xml
Expand Up @@ -53,14 +53,14 @@
<attribute name="domain">['|',('partner_id','=',False), ('commercial_partner_id','=',commercial_partner_id)]</attribute>
</field>
<field name="validity_date" position="before">
<label for="update_prices"/>
<label for="action_update_prices"/>
<br/>
<div groups="!product.group_product_pricelist">
<button name="update_prices" type="object" string=" Update Prices" help="Recompute all prices based on this pricelist" class="btn-link mb-1 px-0" icon="fa-refresh" attrs="{'invisible': [('state', 'in', ['sale', 'done','cancel'])]}"/>
<button name="action_update_prices" type="object" string=" Update Prices" help="Recompute all prices based on this pricelist" class="btn-link mb-1 px-0" icon="fa-refresh" attrs="{'invisible': [('state', 'in', ['sale', 'done','cancel'])]}"/>
</div>
</field>
<xpath expr="//group[@name='order_details']//div[hasclass('o_row')]/button" position="replace">
<button name="update_prices" type="object" string=" Update Prices" help="Recompute all prices based on this pricelist" class="btn-link mb-1 px-0" icon="fa-refresh" attrs="{'invisible': [('state', 'in', ['sale', 'done','cancel'])]}"/>
<button name="action_update_prices" type="object" string=" Update Prices" help="Recompute all prices based on this pricelist" class="btn-link mb-1 px-0" icon="fa-refresh" attrs="{'invisible': [('state', 'in', ['sale', 'done','cancel'])]}"/>
</xpath>
<xpath expr="//group[@name='note_group']" position="before">
<div class="oe_right">
Expand Down

0 comments on commit a4c3ba3

Please sign in to comment.