[IMP] purchase: allow to change price if not invoiced

Steps to reproduce:

- Create Bill from Purchase order
- Raise Refund for the Same Bill

Current Behavior before commit:

Field Unit Price is readonly in PO line as invoice is already created.

Expected behavior:

Price should be editable as Qty Invoiced is Zero after Refund.

With this commit, Price unit will be readonly based on `qty_invoiced`

closes odoo/odoo#74526

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit is contained in:
Swapnesh Shah
2021-07-31 12:54:20 +00:00
committed by GitHub
parent 410efa6012
commit d7b9363361
+1 -1
View File
@@ -249,7 +249,7 @@
force_save="1" optional="show"/>
<field name="product_packaging_qty" attrs="{'invisible': ['|', ('product_id', '=', False), ('product_packaging_id', '=', False)]}" groups="product.group_stock_packaging" optional="show"/>
<field name="product_packaging_id" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" groups="product.group_stock_packaging" optional="show"/>
<field name="price_unit" attrs="{'readonly': [('invoice_lines', '!=', [])]}"/>
<field name="price_unit" attrs="{'readonly': [('qty_invoiced', '!=', 0)]}"/>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use','=','purchase'), ('company_id', '=', parent.company_id)]" context="{'default_type_tax_use': 'purchase', 'search_view_ref': 'account.account_tax_view_search'}" options="{'no_create': True}" optional="show"/>
<field name="price_subtotal" widget="monetary"/>
</tree>