Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UPD] ssi_stock_fixed_asset #76

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ssi_stock_fixed_asset/models/stock_production_lot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ class StockProductionLot(models.Model):
string="Fixed Assets",
comodel_name="fixed.asset.asset",
)
fixed_asset_state = fields.Selection(
string="Fixed Asset State",
related="fixed_asset_id.state",
store=True,
)
30 changes: 29 additions & 1 deletion ssi_stock_fixed_asset/views/stock_production_lot_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<field name="inherit_id" ref="stock.view_production_lot_tree" />
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='product_id']" position="after">
<xpath expr="//field[last()]" position="after">
<field name="fixed_asset_id" />
<field name="fixed_asset_state" />
</xpath>
</data>
</field>
Expand All @@ -24,6 +25,32 @@
<data>
<xpath expr="//field[@name='product_id']" position="after">
<field name="fixed_asset_id" />
<field name="fixed_asset_state" />
</xpath>
<xpath expr="//group" position="before">
<filter
name="dom_is_fixed_asset"
string="Is Fixed Asset"
domain="[('fixed_asset_id','!=',False)]"
/>
<filter
name="dom_is_not_fixed_asset"
string="Is Not Fixed Asset"
domain="[('fixed_asset_id','=',False)]"
/>
<separator />
</xpath>
<xpath expr="//group" position="inside">
<filter
name="grp_fixed_asset"
string="Fixed Asset"
context="{'group_by': 'fixed_asset_id'}"
/>
<filter
name="grp_fixed_asset_state"
string="Fixed Asset State"
context="{'group_by': 'fixed_asset_state'}"
/>
</xpath>
</data>
</field>
Expand All @@ -39,6 +66,7 @@
<page name="fixed_asset" string="Fixed Asset">
<group name="fixed_asset_1" colspan="4" col="2">
<field name="fixed_asset_id" />
<field name="fixed_asset_state" />
</group>
</page>
</xpath>
Expand Down
Loading