Skip to content

Commit

Permalink
ADD change the way context is computed for the wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzPoize committed Feb 6, 2024
1 parent 3b31c0c commit e54d0aa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mrp_bom_configurable/models/input_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

from odoo import api, fields, models


Expand Down Expand Up @@ -48,10 +50,15 @@ def create_boms_from_config(self):
for line in rec.line_ids:
line.create_bom_from_line()

Check warning on line 51 in mrp_bom_configurable/models/input_config.py

View check run for this annotation

Codecov / codecov/patch

mrp_bom_configurable/models/input_config.py#L51

Added line #L51 was not covered by tests

def _get_wizard_context(self):
return {

Check warning on line 54 in mrp_bom_configurable/models/input_config.py

View check run for this annotation

Codecov / codecov/patch

mrp_bom_configurable/models/input_config.py#L54

Added line #L54 was not covered by tests
"active_id": self.id,
}

def open_input_line_wizard(self):
self.ensure_one()
view = self.env.ref("mrp_bom_configurable.input_line_form_wizard_action")
view.context = f"{{'active_id': {self.id} }}"
view.context = json.dumps(self._get_wizard_context())
return view.read()[0]

Check warning on line 62 in mrp_bom_configurable/models/input_config.py

View check run for this annotation

Codecov / codecov/patch

mrp_bom_configurable/models/input_config.py#L59-L62

Added lines #L59 - L62 were not covered by tests

def show_lines(self):
Expand Down

0 comments on commit e54d0aa

Please sign in to comment.