Have a partner with company_id = False
Your user is currently in company A
Before this commit, only FPs with no company id could be set on the partner
After this commit, FP without company or belonging to company A are available
The drawback is that since this computation takes place in an onchange, when you first arrive on the partner
no filter is applied and you can choose whatever FP that appear
This might cause access errors when it is misued
related to #24256closes#24507
Before this commit, a partner in a company could have a fiscal position belonging
to another company
Namely, the search view on the field property account position displayed every fiscal position
This could create problems afterwards, when managing an invoice from a restricted rights user
(with an access right error raising)
After this commit, we soflty constrain the choice of the fiscal position to the ones
belonging to the same company of the partner
OPW 1833848
OPW 1827831
closes#24056
If a user can read account.analytic.account but not the account.move.line,
when he tried to open a partner, there were an raise AccessDenied errors.
opw:782961
- Create 2 companies: A is parent of B.
- Demo is in Company A
- Create 2 invoices for a partner: one in A, one in B (100 each)
- Validate the invoices
Connected as Demo, the 'Invoiced' amount on the partner form view (stat
button) is 100, while clicking on it shows both invoices (total of 200).
There is no need to manually add the company in the `where` clause since
the `_apply_ir_rules` will take care of adding the appropriate
multi-company rules.
opw-772479
- Create 2 companies: A is parent of B.
- Demo is in Company A
- Create 2 invoices for a partner: one in A, one in B (100 each)
- Validate the invoices
Connected as Demo, the 'Invoiced' amount on the partner form view (stat
button) is 100, while clicking on it shows both invoices (total of 200).
There is no need to manually add the company in the `where` clause since
the `_apply_ir_rules` will take care of adding the appropriate
multi-company rules.
opw-772479
- Create 2 companies:
- Company A and check VIES VAT Check
- Company B and do not check VIES VAT Check
- Set current company of admin to Company A and do not allow Company B
- Create a demo user on Company B and give him Adviser group in
Accounting.
- Log in with the demo user.
- Create a Customer A as a company with:
Country = Spain
TIN = ES85847955H
- Create a contact on Customer A: "Contact Sample"
- Create a Customer invoice on "Contact Sample" partner
- Through the menu Accounting/Payments, create a new payment on "Contact
Sample" partner with the total amount of the invoice.
- Open the menu Manual Payments and invoicing matching. The invoice and
the payment should be proposed for reconciliation. Do CTRL+ENTER.
An error message appears: 'The VAT number [ES85847955H] for partner
[Contact Sample] either failed the VIES VAT validation check or did not
respect the expected format ESA12345674.'
This message should not appear as the current user is on Company B which
doesn't have the flag "VIES VAT Check" checked.
The issue comes from the `sudo` in `mark_as_reconciled`, which will lead
to `self.env.user` to be the admin in the VAT check, and therefore
`self.env.user.company_id` will be Company A.
Closes#19274
opw-770018
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.
All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.
Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.
Also removed some dead code or improved the API to remove unnecessary
conversions.
When we are on a partner form view, we get the total invoiced containing
the child contact of the current partner. But when clicking the button
we only see the invoices of exactly the current partner.
In most locations of the code this has changed (since 347c784da) and
this part should also contain the descendants contacts.
opw-744929
closes#17188
In Python 3:
* various builtins and dict methods were changed to return
view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
removed altogether
This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).
Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.
issue #8530
When a partner has a lot of contacts, the computation of the issue total
takes a lot of time. Indeed, it performs the computation for the
partner, but also for all the children, despite the fact that the amount
is not displayed.
opw-726355
Allow to configure the bank statement import mode from kanban
When doing a manual journal entry, don't show the maturity date
Removing Issued total, using credit instead (less code, more
useful to have due amounts, instead of overdue)
Creating a bank, set a name 'BofA Current' and an
account number (that way, the account.account is based
on name)
Settings Wizard & menus: better sentences
Statement CSV Import: installed by default (it
does not add any menu)
remove use_in_payment: complex field, only
used for a default value
Small code cleanup
[IMP] sale: moving order date to secondary tab (strange on a quotation)
Purpose
=======
When using Studio and adding a many2one field for example, it will be easier for a non technical user to find the model res.partner under the name "Contacts" than under the name "Partners".
The where_clause needed a "AND" to work.
The where_clause didn't contain allias for "account_move_line" so when
injecting a condition with "account_move_line" it crashed.
opw:702538
The 'note' field on account.fiscal.position is the "Legal mentions that have to
be printed on the invoices." As the invoice is translated in the customer
language, it makes sense to be able to translate this note too.
Closes#14735