29.01.26
This commit is contained in:
@@ -177,4 +177,14 @@ class InvoiceLine(metaclass=PoolMeta):
|
|||||||
anglo_saxon_move_lines = self._get_anglo_saxon_move_lines(
|
anglo_saxon_move_lines = self._get_anglo_saxon_move_lines(
|
||||||
cost, type_)
|
cost, type_)
|
||||||
result.extend(anglo_saxon_move_lines)
|
result.extend(anglo_saxon_move_lines)
|
||||||
|
#Fee inventoried delivery management
|
||||||
|
if self.lot:
|
||||||
|
FeeLots = Pool().get('fee.lots')
|
||||||
|
fees = FeeLots.search(['lot','=',self.lot.id])
|
||||||
|
for fl in fees:
|
||||||
|
if fl.fee.type == 'ordered' and fl.fee.product.template.landed_cost:
|
||||||
|
AccountMove = Pool().get('account.move')
|
||||||
|
account_move = fl.fee._get_account_move_fee(fl.lot,'out')
|
||||||
|
AccountMove.save([account_move])
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
|
|
||||||
def get_landed_status(self,name):
|
def get_landed_status(self,name):
|
||||||
if self.product:
|
if self.product:
|
||||||
return self.product.landed_cost
|
return self.product.template.landed_cost
|
||||||
|
|
||||||
def get_quantity(self,name=None):
|
def get_quantity(self,name=None):
|
||||||
qt = self.get_fee_lots_qt()
|
qt = self.get_fee_lots_qt()
|
||||||
@@ -376,7 +376,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
if not fee.sale_line:
|
if not fee.sale_line:
|
||||||
feelots = FeeLots.search(['fee','=',fee.id])
|
feelots = FeeLots.search(['fee','=',fee.id])
|
||||||
for fl in feelots:
|
for fl in feelots:
|
||||||
if fee.product.landed_cost:
|
if fee.product.template.landed_cost:
|
||||||
move = fl.lot.get_received_move()
|
move = fl.lot.get_received_move()
|
||||||
if move:
|
if move:
|
||||||
Warning = Pool().get('res.user.warning')
|
Warning = Pool().get('res.user.warning')
|
||||||
@@ -394,7 +394,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
|
|
||||||
return fees
|
return fees
|
||||||
|
|
||||||
def _get_account_move_fee(self,lot):
|
def _get_account_move_fee(self,lot,in_out='in'):
|
||||||
pool = Pool()
|
pool = Pool()
|
||||||
AccountMove = pool.get('account.move')
|
AccountMove = pool.get('account.move')
|
||||||
Date = pool.get('ir.date')
|
Date = pool.get('ir.date')
|
||||||
@@ -404,7 +404,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
if self.product.type != 'service':
|
if self.product.type != 'service':
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.product.landed_cost:
|
if self.product.template.landed_cost:
|
||||||
return
|
return
|
||||||
|
|
||||||
today = Date.today()
|
today = Date.today()
|
||||||
@@ -451,7 +451,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
move_line.amount_second_currency = amount_converted
|
move_line.amount_second_currency = amount_converted
|
||||||
move_line_.debit = Decimal(0)
|
move_line_.debit = Decimal(0)
|
||||||
move_line_.credit = amount
|
move_line_.credit = amount
|
||||||
move_line_.account = self.product.account_stock_in_used
|
move_line_.account = self.product.account_stock_in_used if in_out == 'in' else self.product.account_stock_out_used
|
||||||
if hasattr(move_line_, 'second_currency') and move_line_.second_currency:
|
if hasattr(move_line_, 'second_currency') and move_line_.second_currency:
|
||||||
move_line_.amount_second_currency = -amount_converted
|
move_line_.amount_second_currency = -amount_converted
|
||||||
else:
|
else:
|
||||||
@@ -462,7 +462,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
move_line.amount_second_currency = -amount_converted
|
move_line.amount_second_currency = -amount_converted
|
||||||
move_line_.debit = amount
|
move_line_.debit = amount
|
||||||
move_line_.credit = Decimal(0)
|
move_line_.credit = Decimal(0)
|
||||||
move_line_.account = self.product.account_stock_in_used
|
move_line_.account = self.product.account_stock_in_used if in_out == 'in' else self.product.account_stock_out_used
|
||||||
if hasattr(move_line_, 'second_currency') and move_line_.second_currency:
|
if hasattr(move_line_, 'second_currency') and move_line_.second_currency:
|
||||||
move_line_.amount_second_currency = amount_converted
|
move_line_.amount_second_currency = amount_converted
|
||||||
|
|
||||||
@@ -475,7 +475,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
journal = journal[0]
|
journal = journal[0]
|
||||||
|
|
||||||
description = None
|
description = None
|
||||||
description = 'Fee not inventoried'
|
description = 'Fee'
|
||||||
return AccountMove(
|
return AccountMove(
|
||||||
journal=journal,
|
journal=journal,
|
||||||
period=period,
|
period=period,
|
||||||
|
|||||||
Reference in New Issue
Block a user