Commit Graph

95 Commits

Author SHA1 Message Date
OCA-git-bot
51c4f0dbd1 [BOT] post-merge updates 2024-08-14 15:59:46 +00:00
OCA-git-bot
6cbe28562e [BOT] post-merge updates 2024-04-17 19:32:33 +00:00
Christopher Rogos
d1cb9312ae [MIG] contract: Migration to 17.0 2024-04-10 16:23:33 +00:00
Alicia Garzo Moreno
cffdb62a23 [16.0][IMP] contract: improve visual 2024-03-23 15:10:12 +00:00
Víctor Martínez
4863bb1871 [IMP] contract: Remove buttons from contract lines if recurrence is not per line
If we manage the contract at header level, we must set the end date and last invoice
date there, otherwise data will be inconsistent.

TT48273
2024-03-23 15:10:12 +00:00
Pedro M. Baeza
70dadf7342 [FIX] contract: Fix modifications layout
On the migration to v16, the primary layout view was incorrectly
removed. It's needed because of 2 reasons:

- It's referenced in the following template doing a t-call. Well, this
  one can be avoided calling the new layout upstream template, but...
- This layout is done for placing some extra content (the modifications
  table), as part of the layout that is not shown in the chatter for
  avoiding noise.

We recreate this template inheriting the new layout template, and
adapting it properly.

TT45646
2024-03-23 15:10:12 +00:00
Pedro M. Baeza
6ffeadf949 [IMP] contract: Protect line recurrrency change
If you have defined several contract lines, each one with their
recurrency information, unmarking the check "Line recurrency" by mistake
and saving will make you lose the configuration in one shot, and also
modify the invoceability conditions.

Thus, it's reasonable to avoid to uncheck the mark once you have at
least one invoice issued for a contract with this mark checked.

TT47015
2024-03-23 15:10:12 +00:00
fkantelberg
8c396c4c39 [16.0] contract: Show discount lines for users with the group 'Discount on lines' 2024-03-23 15:10:12 +00:00
Víctor Martínez
b5210b20bc [FIX] contract: Change web_ribbon text to title to make it translatable 2024-03-23 15:10:12 +00:00
fkantelberg
d239c4fd85 [MIG] contract: Remove analytic_account_id and add migration 2024-03-23 15:10:12 +00:00
mymage
b4989403f0 Translated using Weblate (Italian)
Currently translated at 85.7% (270 of 315 strings)

Translation: contract-16.0/contract-16.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract/it/
2024-03-23 15:10:12 +00:00
Jose Suniaga [Vauxoo]
f664cb1730 [FIX] contract: removed dateutil from dependencies
Since Odoo 16.0 has included dateutil on its dependencies,
loading dateutil from here is generating Warning in Odoo.sh
deployments
2024-03-23 15:10:11 +00:00
Carolina Fernandez
4471c5b01d [16.0][FIX] contract: invoice message create 2024-03-23 15:10:11 +00:00
Ivorra78
3ceaa7350b Translated using Weblate (Spanish)
Currently translated at 100.0% (316 of 316 strings)

Translation: contract-16.0/contract-16.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract/es/
2024-03-23 15:10:11 +00:00
Wolfgang Pichler
80ab14eca7 [MIG] contract: Migration to 16.0 2024-03-23 15:10:11 +00:00
Christopher Rogos
a2f60e723e [IMP] Add link to contract in invoice chatter 2024-03-23 15:10:11 +00:00
Víctor Martínez
14afc920ac [IMP] contract: Set invoice_user_id field with Form() to apply the correct values of other fields (team_id for example).
TT39934
2024-03-23 15:10:11 +00:00
Víctor Martínez
fdab299c2b [IMP] contract: Use _prepare_home_portal_values() function. 2024-03-23 15:10:11 +00:00
chandni299
f797fe0056 [15.0][IMP] contract : show tags with colors in the contract 2024-03-23 15:10:11 +00:00
João Marques
8a6982f3a7 [FIX] contract: Remove noupdate in mail template data
TT29820
2024-03-23 15:10:11 +00:00
mariadforgeflow
1b1b2fd477 [FIX] contract: add default_move_type in context 2024-03-23 15:10:11 +00:00
Denis Roussel
88ddff2ebc [FIX+IMP] contract: Several things
- Don't update recurring_next_date as computed
- Compute recurring_next_date for False values too + simplify compute as False values are already taken into account
  In get_next_invoice_date, False values are already taken into account, so, simplifying
  compute_recurring_next_date function.
- Add comment to remind updating method in next version
2024-03-23 15:10:11 +00:00
Jean-Charles Drubay
aad405e568 ADJ: When generating invoices from the Wizard to create invoices manually, reraise any UserError with information about which contract triggered the exception to facilitate the investigation by accountants in case invoices are not generated automatically. 2024-03-23 15:10:11 +00:00
Víctor Martínez
e61cb592d9 [IMP] contract: Add discount + price_subtotal fields to the contract lines in the portal view.
TT34117
2024-03-23 15:10:11 +00:00
Joan Mateu Jordi
850238eb84 [15.0][IMP] modify production beta to stable 2024-03-23 15:10:11 +00:00
manu
f8fdb52745 [FIX] contract: Avoid error in invoicing contracts crone 2024-03-23 15:10:11 +00:00
Jean-Charles Drubay
da393c937d [MIG] contract: Migration to 15.0
Most changes are related to the switch from jinja to qweb in mail templates.

Also included:
- convert deprecated onchange that returns a domain and other deprecation warnings
  (see below)
- Add migration scripts from version 14.0 (force the update of the mail templates)
- Fix warnings from pre-commit checks

Fixes depreciation warnings:

- onchange method ContractAbstractContractLine._onchange_product_id returned
  a domain, this is deprecated
- SavepointCase is deprecated:
  https://github.com/odoo/odoo/blob/15.0/odoo/tests/common.py#L742
- assertDictContainsSubset: According to:
  https://stackoverflow.com/questions/20050913/python-unittests-assertdictcontainssubset-recommended-alternative
2024-03-23 15:10:11 +00:00
João Marques
5ff79bd878 [FIX] contract: Fix invoice creation and salesperson assignment
In v13, the `user_id` field is a related field to `invoice_user_id`, that defaults to the environment user (`self.env.user`).
Therefore, if we try to create an invoice just by passing `user_id`, it would be overwritten by the default computation of `invoice_user_id`.
This fixes it by passing the correct field and data.

TT31715
2024-03-23 15:10:10 +00:00
Alexis de Lattre
042aaf1573 [FIX] contract: fix an obvious crash when self is a multi-recordset 2024-03-23 15:10:10 +00:00
Pedro M. Baeza
eae2dc5a48 [FIX] contract: Cleanup values on line when invoicing
It seems that having several fields returned by `Form` as `False` that
are related to one2many inverse field, makes Odoo ORM mad, and get to
an unbalanced move when generating the invoice.

Cleaning these values assures to work without problems.

Not able to provide a regression test, as I don't get to reproduce the
conditions to happen in test environment, but the patch is safe and
harmless anyways.

TT30842
2024-03-23 15:10:10 +00:00
Ignacio Buioli
9ce76c14a7 Translated using Weblate (Spanish (Argentina))
Currently translated at 100.0% (306 of 306 strings)

Translation: contract-14.0/contract-14.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-14-0/contract-14-0-contract/es_AR/

[UPD] Update contract.pot
2024-03-23 15:10:10 +00:00
Víctor Martínez
6ea141fa4a [IMP] contract: Improve code to show recurring_rule_type from contract line in portal + [FIX] Force add access_token in "View contract" button from contract modification mail 2024-03-23 15:10:10 +00:00
Pedro M. Baeza
d3846e97a2 [FIX] contract: Don't change period start date having line recurrence
Fine-tuning of cd086ddbb4. We shouldn't do
this adjustment if the line recurrence is set, as if so, there's no
possibility of adding post-paid lines with proper dates on a running
contract.
2024-03-23 15:10:10 +00:00
Francisco Ivan Anton Prieto
6965b755e0 [MIG] contract: Migration to 14.0 2024-03-23 15:10:10 +00:00
Francisco Ivan Anton Prieto
cddd13cf5c [IMP] contract: black, isort, prettier 2024-03-23 15:10:10 +00:00
Víctor Martínez
23072ebf7e [FIX] contract: Changed modification_mail auto to appear like email and not internal comment + Generate recurring invoice
Remove line_ids from invoice values to prevent invoice without lines according to https://github.com/odoo/odoo/pull/67879 change
2024-03-23 15:10:10 +00:00
Pedro M. Baeza
b137995193 [OU-FIX] contract: Don't alter v12 recurrence mechanism + Transfer contract info from invoice
We can't guarantee the homogeneity of the existing contracts, so we
keep the line recurrence behavior.
2024-03-23 15:10:10 +00:00
nans
de55a7fb08 [FIX] contract: remove groupby if it is in context + consistency between contract count and contract action
On the commercial entity, the count shows all contracts of child partners.
However clicking on the action might show no contract, as the action only
restricted the domain to the partner itself.
We extract the domain into a function to share it in both cases.

Co-authored by @Lopsanz
2024-03-23 15:10:10 +00:00
Víctor Martínez
7cf5d4547c [FIX] contract: Error in test_contract_invoice_followers 2024-03-23 15:10:10 +00:00
Denis Roussel
b0e941de1e [13.0][FIX] contract: Impossible to create invoices from contract lines as section 2024-03-23 15:10:10 +00:00
Víctor Martínez
67d5c43618 [FIX] contract: Modification mail + Auto-create follower in contract creation related to partner_id + Set groups in back_in_edit_mode link to show only correct users + Prevent first contract modification mail to partner
Co-Authored-By: Pedro M. Baeza <pedro.baeza@tecnativa.com>
2024-03-23 15:10:10 +00:00
Víctor Martínez
7b938dfdc3 [IMP] contract: Add contract modification + contract: Add fields to contract page in portal 2024-03-23 15:10:10 +00:00
Pedro M. Baeza
2e5b3b21d6 [IMP] contract: JS tour on test assets
[UPD] Update contract.pot

[UPD] README.rst
2024-03-23 15:10:10 +00:00
Víctor Martínez
1a1d301251 [IMP] contract: Portal 2024-03-23 15:10:10 +00:00
Víctor Martínez
5b52ee97d0 [IMP] contract: Add followers to invoices created
[UPD] Update contract.pot

[UPD] README.rst
2024-03-23 15:10:10 +00:00
Víctor Martínez
15b1e29650 [FIX] contract: Only include 'section_and_note_one2many' js widget in view fields that contain it 2024-03-23 15:10:10 +00:00
Carlos Roca
f4c0376a62 [IMP] contract: Set a condicion to avoid create lines on invoices 2024-03-23 15:10:10 +00:00
Pedro M. Baeza
017faff34a [MIG] contract: Migration to 13.0
- Standard procedure
- Adapt invoice creation to new account.move
- Tests adapted
2024-03-23 15:10:10 +00:00
Pedro M. Baeza
a425d2a431 [IMP] : black, isort, prettier 2024-03-23 15:10:10 +00:00
Jairo Llopis
1531b29de4 [FIX] contract: do not die if modified partner has contracts in several companies
In a multicompany scenario where a contact belongs to a company and has contracts in several companies, if the user goes to the contact to edit anything, when saving, it will trigger the recomputation of the `commercial_partner_id` field, which gets populated to all the related contracts, and will undeniably fail with an `AccessError`.

A simple test is provided that, without the fix, fails like this:

```
2020-06-25 07:21:24,859 33 ERROR devel odoo.addons.contract.tests.test_contract: ERROR: test_multicompany_partner_edited (odoo.addons.contract.tests.test_contract.TestContract)
2020-06-25 07:21:24,859 33 ERROR devel odoo.addons.contract.tests.test_contract: ` Editing a partner with contracts in several companies works.
2020-06-25 07:21:24,859 33 ERROR devel odoo.addons.contract.tests.test_contract: Traceback (most recent call last):
2020-06-25 07:21:24,859 33 ERROR devel odoo.addons.contract.tests.test_contract: `   File "/opt/odoo/auto/addons/contract/tests/test_contract.py", line 2513, in test_multicompany_partner_edited
2020-06-25 07:21:24,859 33 ERROR devel odoo.addons.contract.tests.test_contract: `     'parent_id': parent_partner.id,
2020-06-25 07:21:24,859 33 ERROR devel odoo.addons.contract.tests.test_contract: `   File "/opt/odoo/auto/addons/partner_autocomplete/models/res_partner.py", line 183, in write
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `     res = super(ResPartner, self).write(values)
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `   File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/res_partner.py", line 570, in write
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `     result = result and super(Partner, self).write(vals)
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `   File "/opt/odoo/auto/addons/mail/models/mail_thread.py", line 321, in write
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `     result = super(MailThread, self).write(values)
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `   File "/opt/odoo/auto/addons/mail/models/mail_activity.py", line 613, in write
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `     return super(MailActivityMixin, self).write(vals)
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `   File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3381, in write
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `     self.recompute()
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `   File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5308, in recompute
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `     target._write(dict(vals))
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `   File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3433, in _write
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `     self.check_access_rule('write')
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `   File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3081, in check_access_rule
2020-06-25 07:21:24,860 33 ERROR devel odoo.addons.contract.tests.test_contract: `     + ' - ({} {}, {} {})'.format(_('Records:'), invalid.ids[:6], _('User:'), self._uid)
2020-06-25 07:21:24,861 33 ERROR devel odoo.addons.contract.tests.test_contract: ` odoo.exceptions.AccessError: ('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: Contract, Operation: write) - (Records: [101], User: 12)', None)
```

@Tecnativa TT24482
2024-03-23 15:10:10 +00:00