main #7
@@ -1892,7 +1892,7 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
|
|||||||
invoice_line.invoice_type = 'in'
|
invoice_line.invoice_type = 'in'
|
||||||
if self.product:
|
if self.product:
|
||||||
if self.product.type == 'service' and not self.product.landed_cost:
|
if self.product.type == 'service' and not self.product.landed_cost:
|
||||||
invoice_line.account = self.product.account_expense_used
|
invoice_line.account = self.product.account_stock_in_used
|
||||||
else:
|
else:
|
||||||
invoice_line.account = self.product.account_stock_in_used
|
invoice_line.account = self.product.account_stock_in_used
|
||||||
if not invoice_line.account:
|
if not invoice_line.account:
|
||||||
|
|||||||
@@ -278,10 +278,10 @@ class Fee(ModelSQL,ModelView):
|
|||||||
logger.info("ADJUST_PURCHASE_VALUES:%s",self)
|
logger.info("ADJUST_PURCHASE_VALUES:%s",self)
|
||||||
if self.type == 'ordered' and self.state == 'not invoiced' and self.purchase:
|
if self.type == 'ordered' and self.state == 'not invoiced' and self.purchase:
|
||||||
logger.info("ADJUST_PURCHASE_VALUES_QT:%s",self.purchase.lines[0].quantity)
|
logger.info("ADJUST_PURCHASE_VALUES_QT:%s",self.purchase.lines[0].quantity)
|
||||||
if self.get_price_per_qt() != self.purchase.lines[0].unit_price:
|
if self.amount != self.purchase.lines[0].unit_price:
|
||||||
self.purchase.lines[0].unit_price = self.get_price_per_qt()
|
self.purchase.lines[0].unit_price = self.amount
|
||||||
if self.quantity != self.purchase.lines[0].quantity:
|
# if self.quantity != self.purchase.lines[0].quantity:
|
||||||
self.purchase.lines[0].quantity = self.quantity
|
# self.purchase.lines[0].quantity = self.quantity
|
||||||
if self.product != self.purchase.lines[0].product:
|
if self.product != self.purchase.lines[0].product:
|
||||||
self.purchase.lines[0].product = self.product
|
self.purchase.lines[0].product = self.product
|
||||||
PurchaseLine.save([self.purchase.lines[0]])
|
PurchaseLine.save([self.purchase.lines[0]])
|
||||||
|
|||||||
Reference in New Issue
Block a user