Skip to content

[19.0][MIG] product_status#2219

Open
SilvioC2C wants to merge 18 commits intoOCA:19.0from
camptocamp:19.0-mig-product_status
Open

[19.0][MIG] product_status#2219
SilvioC2C wants to merge 18 commits intoOCA:19.0from
camptocamp:19.0-mig-product_status

Conversation

@SilvioC2C
Copy link

Depends on #2217, will be rebased once the other PR is merged

@SilvioC2C SilvioC2C force-pushed the 19.0-mig-product_status branch 3 times, most recently from ea01d80 to 01438c7 Compare February 20, 2026 15:38
group_product_state_manager = self.env.ref(
"product_state.group_product_state_manager"
)
self.env.user.write({"group_ids": [(4, group_product_state_manager.id)]})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Command.link here.

st_env = self.env["product.state"]
demo_user = self.demo_user
demo_user.group_ids = [
(4, self.env.ref("product_state.group_product_state_manager").id)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Command.link here.

Comment on lines +3 to +31
<!-- prettier-ignore-start -->
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module', '=', 'product_state'), ('model', '=', 'product.state')]"/>
</function>
<value eval="{'noupdate': False}" />
</function>
<!-- prettier-ignore-end -->

<record id="product_state.product_state_draft" model="product.state">
<field name="active" eval="False" />
</record>

<record id="product_state.product_state_end" model="product.state">
<field name="active" eval="False" />
</record>

<record id="product_state.product_state_obsolete" model="product.state">
<field name="active" eval="False" />
</record>

<!-- prettier-ignore-start -->
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module', '=', 'product_state'), ('model', '=', 'product.state')]"/>
</function>
<value eval="{'noupdate': True}" />
</function>
<!-- prettier-ignore-end -->
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use function to directly write active field on the 3 records, without changing noupdate flag.
Something like:

Suggested change
<!-- prettier-ignore-start -->
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module', '=', 'product_state'), ('model', '=', 'product.state')]"/>
</function>
<value eval="{'noupdate': False}" />
</function>
<!-- prettier-ignore-end -->
<record id="product_state.product_state_draft" model="product.state">
<field name="active" eval="False" />
</record>
<record id="product_state.product_state_end" model="product.state">
<field name="active" eval="False" />
</record>
<record id="product_state.product_state_obsolete" model="product.state">
<field name="active" eval="False" />
</record>
<!-- prettier-ignore-start -->
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module', '=', 'product_state'), ('model', '=', 'product.state')]"/>
</function>
<value eval="{'noupdate': True}" />
</function>
<!-- prettier-ignore-end -->
<function model="product.state" name="write">
<value eval="[ref('product_state.product_state_draft'), ref('product_state.product_state_end'), ref('product_state.product_state_obsolete')]"/>
<value eval="{'active': False}"/>
</function>

@Reyes4711-S73
Copy link
Contributor

@SilvioC2C Plase, remove files of product_state module and add the [DON'T MERGE] commit.
If you do this, the generation of runboat it is done equally.
https://github.com/OCA/maintainer-tools/wiki/Use-temporary-reference(s)-to-another-pull-request(s)

@yankinmax yankinmax force-pushed the 19.0-mig-product_status branch from 01438c7 to e7cd3b4 Compare March 12, 2026 13:07
@yankinmax
Copy link
Contributor

Hello @jcoux @Reyes4711-S73 @vvrossem
Can you pls take a look at this PR?

inverse="_inverse_product_state_id",
default=lambda self: self.product_tmpl_id._get_default_product_state().id,
index=True,
tracking=10,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why a Boolean was not used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.