[FIX] account_asset: posted entries from account asset

The entries created from an asset don't have to be posted if
the asset category has its field "open_asset" set to False.

opw:678771
This commit is contained in:
Goffin Simon
2016-05-31 14:56:08 +02:00
parent a96e60475b
commit 5e8e5b90ee
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -447,7 +447,7 @@ class AccountAssetDepreciationLine(models.Model):
created_moves |= move
if post_move and created_moves:
created_moves.post()
created_moves.filtered(lambda r: r.asset_id and r.asset_id.category_id and r.asset_id.category_id.open_asset).post()
return [x.id for x in created_moves]
@api.multi
@@ -12,6 +12,7 @@
<field name="name">Hardware - 3 Years</field>
<field name="method_number">3</field>
<field name="method_period">12</field>
<field name="open_asset">True</field>
</record>
<record id="account_asset_category_fixedassets_test1" model="account.asset.category">