-
-
Notifications
You must be signed in to change notification settings - Fork 605
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] pos_order_to_sale_order #1065
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,22 @@ class SaleOrderLine(models.Model): | |
|
||
@api.model | ||
def _prepare_from_pos(self, order_line_data): | ||
ProductProduct = self.env["product.product"] | ||
product = ProductProduct.browse(order_line_data["product_id"]) | ||
product_name = product.name | ||
if order_line_data.get("customer_note"): | ||
product_name += "\n" + order_line_data["customer_note"] | ||
return { | ||
vals = { | ||
"product_id": order_line_data["product_id"], | ||
"name": product_name, | ||
"product_uom_qty": order_line_data["qty"], | ||
"discount": order_line_data["discount"], | ||
"price_unit": order_line_data["price_unit"], | ||
"tax_id": order_line_data["tax_ids"], | ||
} | ||
if ( | ||
order_line_data.get("customer_note") | ||
and self.env["ir.config_parameter"] | ||
.sudo() | ||
.get_param("pos_order_to_sale_order.sol_name_mode", "product_pos") | ||
== "product_pos" | ||
): | ||
product = self.env["product.product"].browse(order_line_data["product_id"]) | ||
product_name = product.name | ||
product_name += "\n" + order_line_data["customer_note"] | ||
vals.update(name=product_name) | ||
return vals | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I'm wrong, but it looks like if the previous condition is wrong, the vals returned doesn't contain any "name" value. Did I missed something ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thank you for you question! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
* Go to Point Of Sale / Configuration / Point of Sale | ||
* Check the box 'Create Sale Orders' | ||
* Select the desired default behaviour | ||
* Select the SO Line Name mode | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Select Sales Order Lina name composition mode |
||
|
||
.. figure:: ../static/description/res_config_settings_form.png | ||
:width: 800 px |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Sale order line description computed by default with adding Customer note. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a bug. A feature is being added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if user will remove selection value? So no option is selected