2
0

[FIX] moved method and fields.

This commit is contained in:
lreficent 2017-03-14 13:33:13 +01:00 committed by Andrea Stirpe
parent 085072a3da
commit 00dbaa7f5e
2 changed files with 10 additions and 10 deletions

View File

@ -5,14 +5,14 @@
from openerp import api, models from openerp import api, models
class StockQuant(models.Model): class StockMove(models.Model):
_inherit = "stock.quant" _inherit = "stock.move"
@api.model @api.model
def _prepare_account_move_line(self, move, qty, cost, def _prepare_account_move_line(self, qty, cost,
credit_account_id, debit_account_id): credit_account_id, debit_account_id):
res = super(StockQuant, self)._prepare_account_move_line( res = super(StockMove, self)._prepare_account_move_line(
move, qty, cost, credit_account_id, debit_account_id) qty, cost, credit_account_id, debit_account_id)
for line in res: for line in res:
line[2]['purchase_line_id'] = move.purchase_line_id.id line[2]['purchase_line_id'] = self.purchase_line_id.id
return res return res

View File

@ -102,7 +102,10 @@ class TestAccountMoveLinePurchaseInfo(common.TransactionCase):
# group_ids = [group.id for group in groups] # group_ids = [group.id for group in groups]
product_ctg = self.product_ctg_model.create({ product_ctg = self.product_ctg_model.create({
'name': 'test_product_ctg', 'name': 'test_product_ctg',
'property_stock_valuation_account_id': self.account_inventory.id 'property_stock_valuation_account_id': self.account_inventory.id,
'property_valuation': 'real_time',
'property_stock_account_input_categ_id': self.account_grni.id,
'property_stock_account_output_categ_id': self.account_cogs.id,
}) })
product = self.product_model.create({ product = self.product_model.create({
'name': 'test_product', 'name': 'test_product',
@ -110,9 +113,6 @@ class TestAccountMoveLinePurchaseInfo(common.TransactionCase):
'type': 'product', 'type': 'product',
'standard_price': 1.0, 'standard_price': 1.0,
'list_price': 1.0, 'list_price': 1.0,
'valuation': 'real_time',
'property_stock_account_input': self.account_grni.id,
'property_stock_account_output': self.account_cogs.id,
}) })
return product return product