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

[16.0] [FIX] sale_order_line_price_history: Add discount field only if discount group is enabled #3552

Open
wants to merge 1 commit into
base: 16.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_order_line_price_history/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Known issues / Roadmap
======================

* A backend tour would be nice to have.
* When you are in Kanban View, you can set an historic price from the wizard,
but you need to click on the line and save it from form view instead of
using sale order save button.

Bug Tracker
===========
Expand Down
3 changes: 3 additions & 0 deletions sale_order_line_price_history/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
* A backend tour would be nice to have.
* When you are in Kanban View, you can set an historic price from the wizard,
but you need to click on the line and save it from form view instead of
using sale order save button.
3 changes: 3 additions & 0 deletions sale_order_line_price_history/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>A backend tour would be nice to have.</li>
<li>When you are in Kanban View, you can set an historic price from the wizard,
but you need to click on the line and save it from form view instead of
using sale order save button.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export class SetPriceToLineWidget extends Component {
type: "ir.actions.act_window_close",
infos: {
price_unit: this.props.record.data.price_unit,
discount: this.props.record.data.discount,
...(this.props.record.fields.discount !== undefined && {
discount: this.props.record.data.discount,
}),
},
});
}
Expand Down
6 changes: 6 additions & 0 deletions sale_order_line_price_history/views/sale_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
help="Price History"
/>
</xpath>
<xpath
expr="//field[@name='order_line']/kanban/field[@name='price_unit']"
position="after"
>
<field name="discount" groups="product.group_discount_per_so_line" />
</xpath>
<xpath
expr="//field[@name='order_line']/kanban//t[@t-out='record.price_unit.value']/.."
position="inside"
Expand Down
Loading