Skip to content

Commit eed4ae3

Browse files
committed
[IMP] product_pricelist: some changes done
Removed store=True as it is not needed. Book price is only visible in customer invoices. Code formatting done task - 4602859
1 parent 4cd71df commit eed4ae3

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

product_pricelist/__manifest__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
'category': 'Category',
77
'description': """
88
Book Price (Pricelist Price) on sales order lines and invoice lines
9-
which will be used to compare between Book Price (Pricelist Price) and manually adjusted price on the lines
9+
which will be used to compare between Book Price (Pricelist Price) and
10+
manually adjusted price on the lines.
1011
""",
1112
'license': "LGPL-3",
1213
'data': [

product_pricelist/models/account_move_line.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class AccountMoveLine(models.Model):
55
_inherit = "account.move.line"
66

7-
book_price = fields.Float(string="Book Price", compute="_compute_book_price", store=True)
7+
book_price = fields.Float(string="Book Price", compute='_compute_book_price')
88

99
@api.depends('product_id', 'quantity', 'move_id.invoice_origin')
1010
def _compute_book_price(self):

product_pricelist/models/sale_order_line.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class SaleOrderLine(models.Model):
55
_inherit = "sale.order.line"
66

7-
book_price = fields.Float(string="Book Price", compute="_compute_book_price", store=True)
7+
book_price = fields.Float(string="Book Price", compute='_compute_book_price')
88

99
@api.depends('product_id', 'product_uom_qty', 'order_id.pricelist_id')
1010
def _compute_book_price(self):

product_pricelist/views/account_move_line_views.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<field name="inherit_id" ref="account.view_move_form"/>
77
<field name="arch" type="xml">
88
<xpath expr="//notebook//page//field[@name='invoice_line_ids']//list//field[@name='quantity']" position="before">
9-
<field name="book_price" readonly="True"/>
9+
<field name="book_price" readonly="True" column_invisible="context.get('move_id.move_type') != 'out_inovice'"/>
1010
</xpath>
1111
</field>
1212
</record>

0 commit comments

Comments
 (0)