[16.0][FIX] Avoid repetition of lines at reception#2816
[16.0][FIX] Avoid repetition of lines at reception#2816
Conversation
|
Please @pedrobaeza and @carlos-lopez-tecnativa can you review it? |
|
Tests are in red. |
6fa938b to
61d2a7d
Compare
18fd225 to
b39d765
Compare
|
@pedrobaeza Hi Pedro, there's a constraint in the purchase_order_no_zero_price module that's preventing the tests from running properly. In my opinion, this module shouldn't be involved in the purchase_request module tests. Could you help me by telling me why this might be happening? I'd be very grateful in advance. |
|
Well, why don't you assure your PO lines are not 0 price unit in the tests to avoid it? |
ff19259 to
88356b4
Compare
|
@pedrobaeza I followed your recommendation and it worked. Thank you. Can you review it please? Is smiliar to #2819 but the time zone is not a problem |
| purchase = purchase_request_line.purchase_lines.write({"price_unit": 100.0}) | ||
| self.assertEqual(purchase, True) |
There was a problem hiding this comment.
And the rest for the same.
| purchase = purchase_request_line.purchase_lines.write({"price_unit": 100.0}) | |
| self.assertEqual(purchase, True) | |
| purchase_request_line.purchase_lines.price_unit = 100.0 |
There was a problem hiding this comment.
Thanks, I've already adjusted it.
4bd7128 to
346aa32
Compare
346aa32 to
e1419bc
Compare
|
Hi @victoralmau this PR is similar to #2819 which one you helped me. Can you help again with the review please? |
This change prevents the creation of lines when receiving products. This will also prevent inventory valuation from being corrupted, such that if there is more than one line (stock.move), the valuation will be incorrect when the purchase order has been invoiced previously.
Before
https://github.com/user-attachments/assets/64041144-a51f-47d4-a401-bc69f9844341
After
https://github.com/user-attachments/assets/be2eb62a-dff3-4794-8bf9-ef5c509cfd73