Saturday, November 23, 2024
6 changes · saas-17.2
Miscellaneous changes
Some clients were confused about not knowing why their shifts were not copied after setting a project to them (using the copy previous week feature). The reason was that the project linked to their shifts had allocated hours equal to 0. After this commit, if 0 hours are allocated to the project, we allow to copy the shift anyway to avoid confusion (as some clients are clearly not using this field). task-4074736 version-17.0 Forward-Port-Of: odoo/enterprise#73365
Original PR description
Some clients were confused about not knowing why their shifts were not copied after setting a project to them (using the copy previous week feature). The reason was that the project linked to their shifts had allocated hours equal to 0. After this commit, if 0 hours are allocated to the project, we allow to copy the shift anyway to avoid confusion (as some clients are clearly not using this field). task-4074736 version-17.0 Forward-Port-Of: odoo/enterprise#73365
This commit add the export to xml button on the intrastat report for Germany. More information can be found here: - https://erhebungsportal.estatistik.de/Erhebungsportal/informationen/hilfe-zur-meldungsabgabe-3749 task-4194404 Forward-Port-Of: odoo/enterprise#74249 Forward-Port-Of: odoo/enterprise#71785
Original PR description
This commit add the export to xml button on the intrastat report for Germany. More information can be found here: - https://erhebungsportal.estatistik.de/Erhebungsportal/informationen/hilfe-zur-meldungsabgabe-3749 task-4194404 Forward-Port-Of: odoo/enterprise#74249 Forward-Port-Of: odoo/enterprise#71785
Before this PR, If the deliveryslip report had many fields, say more than 5, they will be all placed on the same line, and it will be very hard to read them since they will be squashed. This is problem is more relevant when the language used for the report is a language where the words are usually long, like the german language. Now, we force at most 4 fields per line, which makes the report layout cleaner in most cases. Before <img width="613" alt="image" src="https://github.com/user-
Original PR description
Before this PR, If the deliveryslip report had many fields, say more than 5, they will be all placed on the same line, and it will be very hard to read them since they will be squashed. This is problem is more relevant when the language used for the report is a language where the words are usually long, like the german language. Now, we force at most 4 fields per line, which makes the report layout cleaner in most cases. Before <img width="613" alt="image" src="https://github.com/user-attachments/assets/49d88491-96d1-4ce3-9e06-73be713956cf"> After <img width="615" alt="image" src="https://github.com/user-attachments/assets/d20337d6-dcc1-46f0-8386-18f67091538c"> opw-4227666 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#184769
This [fixed](https://github.com/odoo/odoo/pull/156423) proposed to avoid infinite loop but still issue is reproducable **steps to reproduce:-** account group is create with ``3 code_prefix`` another account group create with ``31 code_prefix`` and if change the ``3 code_prefix`` something like ``312`` code prefix is changed so it will cyclic parent child relation ``` test_rr=# select id,parent_id,code_prefix_end,code_prefix_start,parent_path from account_group; id | parent_id | cod
Original PR description
This [fixed](https://github.com/odoo/odoo/pull/156423) proposed to avoid infinite loop but still issue is reproducable **steps to reproduce:-** account group is create with ``3 code_prefix`` another…
This [fixed](https://github.com/odoo/odoo/pull/156423) proposed to avoid infinite loop but still issue is reproducable **steps to reproduce:-** account group is create with ``3 code_prefix`` another account group create with ``31 code_prefix`` and if change the ``3 code_prefix`` something like ``312`` code prefix is changed so it will cyclic parent child relation ``` test_rr=# select id,parent_id,code_prefix_end,code_prefix_start,parent_path from account_group; id | parent_id | code_prefix_end | code_prefix_start | parent_path ----+-----------+-----------------+-------------------+------------- 12 | 11 | 31 | 31 | 11 | 12 | 312 | 312 | ``` because this constraint that is introduced in above mentioned pr will not apply on because this is sql update and it will not go check due to python [constraint](https://github.com/odoo/odoo/blob/e20263c4bba3e3cff5b8c7d68f07ce6c7e0bd9aa/addons/account/models/account_account.py#L870). For resolving this checking and reverting the wrong changes done in ``parent_id`` because of the update [query](https://github.com/odoo/odoo/blob/d1be9e4a4ec2cf6eaafe982b5b0036afa5421207/addons/account/models/account_account.py#L911-L927) and preventing from infinite [loop](https://github.com/odoo/enterprise/blob/077d5a0f2bb8d4b1602e993b3e84c5ca9fd877d1/account_reports/models/account_report.py#L1006C15-L1009C44). opw-4342094 upg-2144655 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#188027
Computing the field in su = False was not working as assigned the variable on the sudo environment. The test in 0baa908385 was working as the read computes the display_name in sudo. Forward-Port-Of: odoo/odoo#188347 Forward-Port-Of: odoo/odoo#188310
Original PR description
Computing the field in su = False was not working as assigned the variable on the sudo environment. The test in 0baa908385 was working as the read computes the display_name in sudo. Forward-Port-Of: odoo/odoo#188347 Forward-Port-Of: odoo/odoo#188310
Steps to reproduce: - Create a product tracked by lot with a BOM - Create and confirm an MO for 5 units of that product - Assign a producing lot via the [+] smart button, and produce all - Create, confirm, and validate the shipping for a SO of 3 items of that product - Go back to the MO, unlock it, and change the quantity producing to 10 - Go to the product page, click on "On Hand" > See that there exists 12 products with a lot id, and -5 **without** a lot id Expected behavior: Ther
Original PR description
Steps to reproduce: - Create a product tracked by lot with a BOM - Create and confirm an MO for 5 units of that product - Assign a producing lot via the [+] smart button, and produce all - Create,…
Steps to reproduce:
- Create a product tracked by lot with a BOM
- Create and confirm an MO for 5 units of that product
- Assign a producing lot via the [+] smart button, and produce all
- Create, confirm, and validate the shipping for a SO of 3 items of that product
- Go back to the MO, unlock it, and change the quantity producing to 10
- Go to the product page, click on "On Hand"
> See that there exists 12 products with a lot id, and -5 **without** a lot id
Expected behavior:
There should be 7 products with lot it, and **NO products without lot id**
Cause of the issue:
When increasing the quantity producing, the newly created stock move line
(SML) is created without a lot id: https://github.com/odoo/odoo/blob/d5a7a3d02e3e2b4e47977abc8b9fc0d5d6135937/addons/stock/models/stock_move.py#L1471-L1477
Then only later, we update this new created move line to give it a lot_id
https://github.com/odoo/odoo/blob/a4ca3a3d6eb368bebcbcad00d81e098ee86a8610/addons/mrp/models/mrp_production.py#L900-L901
This update will first cause an undo of some move lines, calling `_synchronize_quant` (first call)
https://github.com/odoo/odoo/blob/49d25c58db2329d097566dc222d97cd8988d640d/addons/stock/models/stock_move_line.py#L459-L461
then, the actual lot_id update is committed
https://github.com/odoo/odoo/blob/49d25c58db2329d097566dc222d97cd8988d640d/addons/stock/models/stock_move_line.py#L473
then after that, another call to `_synchronize_quant` is being made to apply the changes (second call) https://github.com/odoo/odoo/blob/49d25c58db2329d097566dc222d97cd8988d640d/addons/stock/models/stock_move_line.py#L476-L477
However, since `_synchronize_quant` depends on reading the untracked quantities to decide
if it can compensate for negative values
https://github.com/odoo/odoo/blob/49d25c58db2329d097566dc222d97cd8988d640d/addons/stock/models/stock_move_line.py#L645
it sees different value of `untracked_qty` in the first call than that in the second call,
which makes things go out of sync.
Solution:
The newly created move line has the correct lot_id at the moment of the creation,
so we avoid the issue of updating it later, and risking the quantities to go out of sync.
Another solution might be to edit the `write` method of `StockMoveLine`, by committing
changes related to lot_id before undoing any move lines
```py
if updates['lot_id'] and ml.lot_id != updates['lot_id']:
super(StockMoveLine, ml).write({ 'lot_id': updates['lot_id'] })
# then here proceed to undoing
```
opw-4043539
Forward-Port-Of: odoo/odoo#187526