Commit Graph

373 Commits

Author SHA1 Message Date
sbejaoui
bf8845d683 [12.0][IMP] - extend contract line at renewal 2021-11-09 10:08:00 +07:00
sbejaoui
2cd93a819c [12.0][IMP] - add new option: create_new_line_at_contract_line_renew
Add a company config option to decide whether to create or to extend contract
line at renew action
2021-11-09 10:08:00 +07:00
sbejaoui
654c45c153 [12.0][ADD] - Add note field to contract 2021-11-09 10:08:00 +07:00
sbejaoui
0ff7a4cfd1 [12.0][FIX] - raise an error when next invoice date before the last date invoiced 2021-11-09 10:08:00 +07:00
sbejaoui
c9b304bf36 [12.0][IMP] - Add failing test for next invoice date before the last date invoiced 2021-11-09 10:08:00 +07:00
Augusto D. Lisbôa
4803341f26 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (216 of 216 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/pt_BR/
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
b117a728bc [IMP] contract: display invoicing offset 2021-11-09 10:08:00 +07:00
Bejaoui Souheil
4fb5f8bddf [REF] contract: simplify _get_period_to_invoice 2021-11-09 10:08:00 +07:00
sbejaoui
0814555b14 [IMP] contract: add unit test for different combinations for next invoicing period 2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
b7b993a153 [REF] contract: rename _get_recurring_next_date as get_next_invoice_date
It is easier to understand. Also make it public.
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
07a13242f3 [REF] contract: make get_next_period_date_end public
Make it public because it is the core logic of the module.
Also, clarify that recurring_invoicing_type
and recurring_invoicing_offset are needed only when
we want the next period to be computed from a
user chosen next invoice date.
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
901d934ed8 [REF] contract: make recurring_invoicing_offset a computed field
In preparation to making it user modifiable.
2021-11-09 10:08:00 +07:00
sbejaoui
3257a058f4 [FIX] contract: Improve unit tests 2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
5636fa9894 [IMP] contract: support pre-paid for monthlylastday
monthlylastday is (almost) not a special case anymore \o/.
montlylastday is simply a montly period where the
periods are aligned on month boundaries.
The last bit of special casing is that postpaid generates
invoice the day after the last dasy of the period, except
for monthlylastday where the invoice is generated on the
last day of the period. This last exception will disappear
when we put the offset under user control.

This is a breaking change because the post-paid/pre-paid
mode becomes relevant for monthlylastday invoicing.
The field becomes visible in the UI. Code that generate
monthlylastday contract lines must now correctly set
the pre-paid/post-paid mode too. Some tests have had
to be adapted to reflect that.
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
8d9c4a3df5 [REF] contract: remove one monthlylastday special case
get_relative_delta now works the same for all recurring rules.
Move the special case handling to _init_last_date_invoiced
which is used only for migration.
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
b7acd45d83 [FIX] contract: add missing dependency in computed field 2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
a5983e2eea [REF] contract: re-add _compute_first_recurring_next_date
For backward compatibility
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
f1c5ad37ca [REF] contract: refactor _update_recurring_next_date
Reuse the logic that is now fully located in _get_recurring_next_date.
2021-11-09 10:08:00 +07:00
Martronic SA
1d17f350fc Translated using Weblate (French)
Currently translated at 40.1% (85 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/fr/
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
f717692a25 [REF] contract: refactor _get_period_to_invoice
Move the part of the logic that compute the next
period depending on the chosen next invoice date
to _get_next_period_date_end.
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
01fe31de0e [IMP] contract: add next period start/end fields
Add two computed field showing the next period
start and end date. This improve the UX and will
enable further simplifications in the code.
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
7a24716cda [REF] contract: handle max_date_end in _get_recurring_next_date
This concentrates all next date calculation
logic in one place, and will allow further simplifications.
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
6c12c3636e [REF] contract: clarify _get_recurring_next_date
First compute the next period end date,
then derive the next invoice date from the next
period stard and end date.
2021-11-09 10:08:00 +07:00
Stéphane Bidoul (ACSONE)
ab20ff9d3f [REF] contract: rename misnamed methods 2021-11-09 10:08:00 +07:00
Pedro M. Baeza
e451ca97d6 [FIX] contract: Tests with duplicated name
So they are not executed at all. Detected by chance looking for a test for the other PR.
2021-11-09 10:08:00 +07:00
Pedro M. Baeza
5ffcb9eb8e [FIX] contract: Don't execute onchange after invoice creation
Using that approach (that is the current one in core)  has a lot of side effects and
performance bottlenecks. You can read odoo/odoo#40156 for summarizing them.

This also improves the handling of the values of payment term an fiscal position
for using the partner ones if not set.
2021-11-09 10:08:00 +07:00
sbejaoui
80be75d6be [12.0][FIX] - Run onchange contract_type when changing the contract template
Fix this use-case:

If the contract journal is not set on the contract template the contract is created
without a journal when confirming the sale order
2021-11-09 10:08:00 +07:00
Bole
a4aebd585e Translated using Weblate (Croatian)
Currently translated at 22.2% (47 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/hr/
2021-11-09 10:08:00 +07:00
Pedro M. Baeza
4dd036e95f [MIG][FIX] contract: Move contracts, but disable them
There were an error in previous query for moving only contracts with the mark checked,
but it's also more logic to move them, but remain them disabled.
2021-11-09 10:07:59 +07:00
Sergio Teruel
699632825a [IMP] contract: Fix test crash with other modules 2021-11-09 10:07:59 +07:00
Bole
a7623f6571 Translated using Weblate (Croatian)
Currently translated at 21.7% (46 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/hr/
2021-11-09 10:07:59 +07:00
Pedro M. Baeza
2b5e913a5e [MIG] contract: No contract on AA without recurring invoices flag
Don't transfer to contract those analytic accounts with the "Recurring invoicing" flag
unchecked.
2021-11-09 10:07:59 +07:00
sbejaoui
5418e3569c [12.0][FIX] - contract company must be the same as the sale order
When creating a contract from a sale order the company must be the sale order
company and not the user company
2021-11-09 10:07:59 +07:00
sbejaoui
0a52bc826c [12.0][FIX] - Fix contract partner label
the label Partner (always False) don't make any sens
2021-11-09 10:07:59 +07:00
sbejaoui
2ace7aee59 [12.0][FIX] - Fix performance issue on contract line read
multi-company record rules on contract line causes performance issue
2021-11-09 10:07:59 +07:00
Josep M
642179bbb3 Translated using Weblate (Spanish)
Currently translated at 100.0% (212 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/es/
2021-11-09 10:07:59 +07:00
Rudolf Schnapka
627caaa561 Translated using Weblate (German)
Currently translated at 99.1% (210 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/de/
2021-11-09 10:07:59 +07:00
sbejaoui
dd6eefd1eb [12.0][FIX] - Fix contract report 2021-11-09 10:07:59 +07:00
sbejaoui
4c1b61dc8d [IMP] - Add multi-company access rule for contract objects 2021-11-09 10:07:59 +07:00
Thomas Pot
8fe1166c67 Translated using Weblate (Dutch)
Currently translated at 98.1% (208 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/nl/
2021-11-09 10:07:59 +07:00
Pedro M. Baeza
4be5cb5b17 [MIG] contract: Create contract sequence for allowing to create records 2021-11-09 10:07:59 +07:00
黎伟杰
7c5e4dfc69 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (212 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/zh_CN/
2021-11-09 10:07:59 +07:00
Pedro M. Baeza
8eaf8f0210 [MIG] contract: Missing renaming of invoice link
Done through `oldname`.
2021-11-09 10:07:59 +07:00
Eder Brito
fcc33693a6 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (212 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/pt_BR/
2021-11-09 10:07:59 +07:00
Albert Pons
f1a5147bec Translated using Weblate (Catalan)
Currently translated at 61.3% (130 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/ca/
2021-11-09 10:07:59 +07:00
Enrique
74b76aed8d [12.0][FIX] contract & contract_sale - security fix
The lowest model access for contract.contract model is group_account_invoice group. However the addon adds two smart buttons to res.partner view without any security restrictions and without compute_sudo attribute on computed fields.
This causes the view to crash when a user without the proper permissions tries to access the res.partner form view.
The solution adds groups_id to the partner form views in which the buttons are added, so the only loads when the user has proper permissions.
Other way to solve it would be to add compute_sudo attribute to the relevant fields, but this causes an access error when the user clicks on the smart buttons.
2021-11-09 10:07:59 +07:00
Maria Sparenberg
77695755bd Translated using Weblate (German)
Currently translated at 78.8% (167 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/de/
2021-11-09 10:07:59 +07:00
Pedro M. Baeza
b7e09a279f [MIG] contract: Assign old partner's salesman to migrated contracts
As v11 takes salesman from linked partner and now the salesman is a field in the
contract that is initialized to current user, we need to assign to the recently
converted contracts following old logic, or they will have admin as responsible.
2021-11-09 10:07:59 +07:00
Lorenzo Battistini
cfae247c6a Translated using Weblate (Italian)
Currently translated at 96.2% (204 of 212 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/it/
2021-11-09 10:07:59 +07:00
hparfr
c9664eb8e6 Add commercial_partner_id fields into contract module
Remove string attribute
2021-11-09 10:07:59 +07:00