Skip to content

[18.0][IMP] sale_elaboration: use state instead of parent.state#4363

Open
CarlosRoca13 wants to merge 1 commit into
OCA:18.0from
Tecnativa:18.0-IMP-sale_elaboration
Open

[18.0][IMP] sale_elaboration: use state instead of parent.state#4363
CarlosRoca13 wants to merge 1 commit into
OCA:18.0from
Tecnativa:18.0-IMP-sale_elaboration

Conversation

@CarlosRoca13
Copy link
Copy Markdown
Contributor

parent.state is only available when a view is rendered embedded inside a One2many (e.g. the order_line subform). When sale.order.line is opened as a standalone form (sale_order_line_view_form_readonly), there is no parent context, causing Owl to raise:

EvalError: Name 'parent' is not defined

sale.order.line already exposes state = fields.Selection(related='order_id.state'), so replacing parent.state with state is semantically equivalent and works in both embedded and standalone contexts.

cc @Tecnativa TT62707

ping @sergio-teruel @carlosdauden

`parent.state` is only available when a view is rendered embedded inside a One2many (e.g. the order_line subform). When `sale.order.line` is opened as a standalone form (sale_order_line_view_form_readonly), there is no parent context, causing Owl to raise:

EvalError: Name 'parent' is not defined

`sale.order.line` already exposes `state = fields.Selection(related='order_id.state')`, so replacing `parent.state` with `state` is semantically equivalent and works in both embedded and standalone contexts.
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @yajo, @rafaelbn, @sergio-teruel,
some modules you are maintaining are being modified, check this out!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants