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] pos_order_to_sale_order #1065

Closed

Conversation

geomer198
Copy link
Contributor

At creating SO from POS, description computed by default with adding customer note from POS.

@OCA-git-bot
Copy link
Contributor

Hi @legalsylvain,
some modules you are maintaining are being modified, check this out!

@geomer198 geomer198 marked this pull request as draft October 15, 2023 12:41
@geomer198 geomer198 marked this pull request as ready for review October 15, 2023 15:18
@geomer198 geomer198 force-pushed the 16.0-t2928-pos_order_to_sale_order-fix branch from af6760e to c5673c1 Compare October 15, 2023 15:18
Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. Don't understand that PR.
I tested on runboat with the 16.0 module :

  • add a pos order line
  • add a comment
  • create a draft sale order

the comment is present in the name of the sale order line.

image

@geomer198
Copy link
Contributor Author

Hi. Don't understand that PR. I tested on runboat with the 16.0 module :

* add a pos order line

* add a comment

* create a draft sale order

the comment is present in the name of the sale order line.

image

In default module behavior product internal reference in sol is not displayed. Now products Internal reference is displayed.

@legalsylvain
Copy link
Contributor

Thanks for the explanation !

Well, the problem IMO is that this PR introduce a useless field at sale.order.line level that will take space in the DB. We should consider another design.

I guess call _get_sale_order_line_multiline_description_sale in the prepare function should do the job. Don't you think ?

@geomer198
Copy link
Contributor Author

_get_sale_order_line_multiline_description_sale

Hello @legalsylvain ! This function (_get_sale_order_line_multiline_description_sale) is called after created SOL, so at preparing value I think better solution adding new field for saving customer_note.
For the applying _get_sale_order_line_multiline_description_sale function then need create so and sol without preparing value. I think this solution is not good(
What do you think about it?

@legalsylvain
Copy link
Contributor

I think you can pass information by context. It could make the job.
but creating a useless field in database is an issue IMO.

@ivs-cetmix
Copy link
Member

I think you can pass information by context. It could make the job. but creating a useless field in database is an issue IMO.

Hi @legalsylvain we have approached this problem from another angle) Could you have a look please?

@legalsylvain
Copy link
Contributor

Hi. I'm on holidays the next week. I'll take a look when I'm back to the office.

@ivs-cetmix
Copy link
Member

Hi. I'm on holidays the next week. I'll take a look when I'm back to the office.

Thank you! Have a nice holidays)

At creating SO from pos, description computed by default with adding customer note from POS.
@geomer198 geomer198 force-pushed the 16.0-t2928-pos_order_to_sale_order-fix branch from a96796a to 0188833 Compare October 20, 2023 11:29
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Select Sales Order Lina name composition mode

@@ -0,0 +1 @@
Sale order line description computed by default with adding Customer note.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a bug. A feature is being added.
Add readable and clear feature description please

("multiline", "Sale Multiline Description"),
],
string="SO Line Name Mode",
default="product_pos",
Copy link
Member

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

…efault value for config paramenter is changed.
@geomer198 geomer198 force-pushed the 16.0-t2928-pos_order_to_sale_order-fix branch from c0f0d57 to fc3ab80 Compare October 22, 2023 18:11
@ivs-cetmix
Copy link
Member

Hi. I'm on holidays the next week. I'll take a look when I'm back to the office.

Hi @legalsylvain sorry for bothering you again) Would be great if you could have a look at this

product_name = product.name
product_name += "\n" + order_line_data["customer_note"]
vals.update(name=product_name)
return vals
Copy link
Contributor

Choose a reason for hiding this comment

The 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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 ?

Thank you for you question!
Name field is auto complete after creating SOL. And this solution for the set custom value for SOL description.

@legalsylvain
Copy link
Contributor

Hi @geomer198.

Hello @legalsylvain ! This function (_get_sale_order_line_multiline_description_sale) is called after created SOL, so at preparing value I think better solution adding new field for saving customer_note.

I don't think so. _get_sale_order_line_multiline_description_sale is called by the _compute_name function, before the call during the call of create.

I made an alternative implementation here #1080.

Thanks for you review.

@geomer198
Copy link
Contributor Author

Hi @geomer198.

Hello @legalsylvain ! This function (_get_sale_order_line_multiline_description_sale) is called after created SOL, so at preparing value I think better solution adding new field for saving customer_note.

I don't think so. _get_sale_order_line_multiline_description_sale is called by the _compute_name function, before the call during the call of create.

I made an alternative implementation here #1080.

Thanks for you review.

Thanks for your solution.
This solution looks better than my. I close my PR in favor of your implementation.

@geomer198 geomer198 closed this Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants