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

[IMP] add section & note edition in option lines #26

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions sale_configurator_base/models/ir_ui_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def _get_sale_line_tree_item(self):
)
doc = etree.XML(res["arch"])
fields = doc.xpath("//field[@name='order_line']/tree/field")
controls = doc.xpath("//field[@name='order_line']/tree/control")
items = []
for field in fields:
# We remove attrs on price_subtotal as they depend on field parent_id
Expand All @@ -30,6 +31,8 @@ def _get_sale_line_tree_item(self):
# We remove this field that do not make sense on child view
if field.get("name") != "price_config_subtotal":
items.append(field)
for clt in controls:
items.append(clt)
return items

def _get_sale_line_form_item(self):
Expand Down
1 change: 1 addition & 0 deletions sale_configurator_option/views/sale_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/>
<field
name="option_ids"
widget="section_and_note_one2many"
context="{'default_order_id': order_id}"
attrs="{'invisible': [('is_configurable_opt', '=', False)]}"
>
Expand Down