You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: addons/account/models/product.py
-16Lines changed: 0 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -35,22 +35,6 @@ class ProductTemplate(models.Model):
35
35
domain=[('deprecated', '=', False)],
36
36
help="The expense is accounted for when a vendor bill is validated, except in anglo-saxon accounting with perpetual inventory valuation in which case the expense (Cost of Goods Sold account) is recognized at the customer invoice validation. If the field is empty, it uses the one defined in the product category.")
37
37
38
-
@api.multi
39
-
defwrite(self, vals):
40
-
#TODO: really? i don't see the reason we'd need that constraint..
41
-
check=self.idsand'uom_po_id'invals
42
-
ifcheck:
43
-
self._cr.execute("SELECT id, uom_po_id FROM product_template WHERE id IN %s", [tuple(self.ids)])
44
-
uoms=dict(self._cr.fetchall())
45
-
res=super(ProductTemplate, self).write(vals)
46
-
ifcheck:
47
-
self._cr.execute("SELECT id, uom_po_id FROM product_template WHERE id IN %s", [tuple(self.ids)])
raiseUserError(_('You can not change the unit of measure of a product that has been already used in an account journal item. If you need to change the unit of measure, you should archive this product and create a new one.'))
sql= ("""SELECT 0 AS lid, l.account_id AS account_id, '' AS ldate, '' AS lcode, NULL AS amount_currency, '' AS lref, 'Initial Balance' AS lname, COALESCE(SUM(l.debit),0.0) AS debit, COALESCE(SUM(l.credit),0.0) AS credit, COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) as balance, '' AS lpartner_id,\
41
+
sql= ("""SELECT 0 AS lid, l.account_id AS account_id, '' AS ldate, '' AS lcode, 0.0 AS amount_currency, '' AS lref, 'Initial Balance' AS lname, COALESCE(SUM(l.debit),0.0) AS debit, COALESCE(SUM(l.credit),0.0) AS credit, COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) as balance, '' AS lpartner_id,\
42
42
'' AS move_name, '' AS mmove_id, '' AS currency_code,\
43
43
NULL AS currency_id,\
44
44
'' AS invoice_id, '' AS invoice_type, '' AS invoice_number,\
0 commit comments