Tuesday, January 7, 2020
6 changes · master
Resolved issues and error corrections
This change removes a broken address-autocomplete bridge that could incorrectly split street details and disrupt extended address behavior. It also strengthens extended address handling so company and partner street information stays consistent, with clearer tests to reduce future regressions.
Original PR description
PURPOSE Remove partner_autocomplete_address_extended and ensure base_address_extended effectively works. SPECIFICATIONS Commits a6e1eb9 and 8a1815b added among a lot of other things a bridge module…
PURPOSE
Remove partner_autocomplete_address_extended and ensure base_address_extended
effectively works.
SPECIFICATIONS
Commits a6e1eb9 and 8a1815b added among a lot of other things
a bridge module between ``partner_autocomplete`` and ``base_address_extended``.
It is used only to redefine the ``_split_street_with_params`` method from
``base_address_extended``. This method is used to find street name, number and
number2 from an address, given a format coming from the country.
However the override completely fucks up the original method purpose and uses
an hardcoded regex coming out of the blue. Parameters like country format is
not taken into account which is annoying when trying to parse country dependent
data.
Tests from ``base_address_extended`` crash completely when used with the
``partner_autocomplete_address_extended`` implementation.
Considering the original complete specifications from commits
"""
For Name field or M2O, gives a list of companies
Data comes from Odoo IAP Service
"""
Or specs found in the original task ID 1867818 pad
"""
If Extended Address module is installed, the street number should be correctly
splitted Or the complete address is put in street2 if impossible to parse
"""
We think that this implementation is broken by design. Indeed there is no
mention of street2 anywhere in the code, and this implementation ensure street
will never be correctly split. We therefore remove it completely.
In this merge we also
* clean and improve tests in base_address_extended. Purpose is to make tests
easier to understand and more data oriented. Tests about company / partner
address fields are added to ensure coherency;
* reorganize python code of base_address_extended according to guidelines;
* rename compute / inverse methods of base_address_extended;
* remove dead code from base partner model;
See sub commits for more details.
LINKS
Task ID 2158302
PR #42678This fixes an empty blank space that appeared in product settings when website sales and event sales were installed together. The product form layout is reorganized so related options appear in the right place, improving clarity without changing business workflows.
Original PR description
Task : https://www.odoo.com/web#id=2150643&model=project.task&view_type=form&menu_id=4720 Pad : https://pad.odoo.com/p/r.2eaa5df3bef2cec6d157c5fc41fbd0f5 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Website theme preview images now load correctly even when the Website app is installed from the command line instead of the apps screen. This makes theme selection more consistent for deployments and automated setup processes.
Original PR description
Themes image would not be shown correctly in the theme selection if the `website` module was installed in CLI. Indeed, the code supposed to load the theme images was done in the kanban view during theme selection after installing module through apps screen. Now, this code is encapsulated and called in post_init hook of website. This was also needed for an improvement on `test_themes` module, see odoo/design-themes#195.
Deleting records that automatically remove related items now goes through Odoo's normal cleanup process. This helps ensure related files are removed and dependent totals or stored values are updated correctly, reducing stale data and orphaned attachments.
Original PR description
**Description of the issue/feature this PR addresses:** When you unlink a purchase, the lines are unlink by the `SQL CASCADE` fonction. It is more quicker but the ORM `unlink()` of lines is not…
**Description of the issue/feature this PR addresses:**
When you unlink a purchase, the lines are unlink by the `SQL CASCADE` fonction. It is more quicker but the ORM `unlink()` of lines is not applied. It is an issue, indead the attachments of lines are not unlink, and computed field liked to the lines are not re-computed (computed field in an other model).
This PR propose to unlink cascade records by ORM.
I think there is no case in the Odoo code where this situation exist.
FIX:
- delete attachment of cascade deleted records
- on cascade modified field modified is not apply
IMP:
- full logger of what is delete in database (if you delete a purchase order, you see also log about the purchase line)
- don't clear all the cache
**Exemple**
```python
Order()
_name='order'
lines_ids = fields.One2many('order.line','order_id')
OrderLine():
_name='order.line'
order_id = fields.Many2one('order', ondelete='cascade')
value = fields.Integer(default=10)
file = fields.Binary(attchment=True)
Truc()
_name='truc'
order_line_ids = fields.Many2many('order.line', store=True)
total = fields.Integer(compute='_get_total', store=True, readonly=True)
@api.depends('order_line_ids.value')
def _get_total(self):
for rec in self:
rec.total = sum(rec.order_line_ids.mapped('value')
```
Excecute
`order = self.env['order'].create({'line_ids':[(0,0,{'file': 'dscsd'})]})`
note the id of attachment with SQL request (don't use web UI, it don't show).
`SELECT * FROM ir_attachment`
`order.unlink()`
**Current behavior before PR:**
- make in postgre `SELECT * FROM ir_attachment WHERE id = x`, you can see the attachment (and it still present in the file store.
- `truc.total` is not recomputed
**Desired behavior after PR is merged:**
- file as been deleted.
- `truc.total` is recomputed
**Todo :**
- [x] fix recursion issue
- [x] save cascade field in the registry (remove the `env['ir.module.fields'].search()`)
- [ ] update test
- [x] fix company depend field
- [x] clear more cache (ondelete = 'set nul'
@odony @rco-odoo @nim-odoo
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis fixes an issue that could prevent a restaurant point of sale session from resuming correctly when the restaurant POS module is installed. The change adds a safer check for missing data so users can continue shop operations without interruption.
Original PR description
This is a followup to the fix made in 99615ff6cc0559f6661001e5493876f2d5b69248. When calling JSON.stringify to undefined, it results to undefined, thus, it is necessary to check if the value is undefined before JSON.parse'ing it. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update removes an obsolete view adjustment in the Sales Renting module that no longer has any effect. It helps keep the product form configuration cleaner and reduces maintenance risk without changing user-facing rental workflows.
Original PR description
Task : https://www.odoo.com/web#id=2150643&model=project.task&view_type=form&menu_id=4720 Pad : https://pad.odoo.com/p/r.2eaa5df3bef2cec6d157c5fc41fbd0f5