Commit Graph

152 Commits

Author SHA1 Message Date
chandni299
babc25a895 [12.0][IMP] contract : show tags with colors in the contract 2022-07-27 13:24:48 +02:00
Quentin Groulard
b31574d211 [12.0][ADD] Add link to contract line in contract chatter messages 2022-06-20 10:00:12 +02:00
manu
5b22d23857 [FIX]contract: In Progress state search 2021-12-29 10:32:32 +01:00
manu
cf7775343d [FIX]contract: Avoid error in invoicing contracts crone 2021-10-29 16:56:06 +02:00
nans
9426414881 [IMP] contract: add date_start field on contracts 2021-07-21 13:22:42 +02:00
OCA-git-bot
1364cf4a41 Merge PR #613 into 12.0
Signed-off-by pedrobaeza
2021-03-17 09:21:26 +00:00
Víctor Martínez
d3977be6f7 [FIX] contract: Changed modification_mail auto to appear like email and not internal comment 2021-03-16 16:13:08 +01:00
OCA-git-bot
29327f2d57 Merge PR #642 into 12.0
Signed-off-by pedrobaeza
2021-03-15 07:58:08 +00:00
Yu Weng
8b66647309 [FIX] contract: function _get_partner_contract_domain of res.partner 2021-03-12 13:00:22 +01:00
newtratip
0fbfa4f89c [12.0][FIX] contract: consistency between contract count and contract action 2021-02-23 21:33:18 +07:00
nans
22c35e2d0b [FIX] contract: consistency between contract count and contrct 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.
2021-02-16 13:41:16 +01:00
nans
c0284bcd2d [FIX] contract: remove groupby if it is in context
Co-authored by @Lopsanz
2021-02-15 12:11:55 +01:00
Víctor Martínez
ff520c9e53 [FIX] contract: Prevent first contract modification mail to partner 2021-01-22 10:11:06 +01:00
Víctor Martínez
e817effeea [FIX] contract: Set groups in back_in_edit_mode link to show only correct users 2021-01-19 09:42:41 +01:00
Víctor Martínez
25baee81f9 [FIX] contract: Modification mail + Auto-create follower in contract creation related to partner_id
Co-Authored-By: Pedro M. Baeza <pedro.baeza@tecnativa.com>
2021-01-15 09:24:35 +01:00
Víctor Martínez
6daf88a437 [FIX+IMP] contract: Fix tests + Batch modifications 2020-12-25 12:07:46 +01:00
Pedro M. Baeza
c09c93cda6 [FIX+IMP] contract: Make template to work + other refinements
- Contract modification subtype non default
- Hybrid template between mail.template Jinja + inheritable QWeb
- QWeb element qualified for easing inheritance
- Translations updated
- _modification_mail_send multi-record
- Tests resilience
2020-12-24 09:43:34 +01:00
Víctor Martínez
a9f65b439a [IMP] contract: Add contract modification 2020-12-23 18:43:16 +01:00
Víctor Martínez
305ca3f540 [IMP] contract: Portal 2020-12-14 08:49:11 +01:00
Víctor Martínez
e093a51bbc [IMP] contract: Add followers to invoices created 2020-12-02 09:16:03 +01:00
sbejaoui
33dd132324 [12.0][FIX] - fiscal position, payment mode and pricelist obtained according to contract company 2020-08-18 09:56:05 +02:00
Harshad
dcc55ee073 [FIX] looping over invoices to write a message from reccuring invoice create 2020-08-06 21:50:25 +05:30
Jairo Llopis
3cc63c8b12 [FIX] contract: return qcontext result
Duh... 🤓 Obvious regression from #535

@Tecnativa TT24657
2020-07-28 12:55:14 +02:00
Jairo Llopis
48b0aefff6 [FIX] contract: multi-company assignment notification
Steps to reproduce the problem:

1. Log in as Mitchell Admin.
2. Create contract CNT-A for company CMP-A, assigned to Marc Demo.
3. Create contract CNT-B for company CMP-B, assigned to Marc Demo.
4. Run cron to create recurring invoices.

Actual results:

- Odoo sends automated assignment emails to Marc Demo, which indicate the name of the company activated for `__system__` user whlie the cron was being executed.

Expected results after this patch:

- Odoo sends automated assignment emails to Marc Demo, which indicate the invoice company.

@Tecnativa TT24657
2020-07-28 10:30:40 +02:00
OCA-git-bot
90272ecebe Merge PR #523 into 12.0
Signed-off-by pedrobaeza
2020-07-17 15:00:40 +00:00
Pedro M. Baeza
3fd703b88b [FIX] contract: Proper o2m field definition
It should be inverse_name, not inverse.
2020-07-15 17:56:07 +02:00
Pedro M. Baeza
5c4f40ebd0 [FIX] contract: Proper depends for create_invoice_visibility
Although is not probable that you change these fields once created, a proper
dependency chain can save several problems.
2020-07-15 17:52:49 +02:00
Pedro M. Baeza
0bd79f93fd [FIX] contract: Proper domain for state "in progress"
Previous domain was doing an AND operation over same field (is_auto_renew) with
both False/True, which can't be possible.
2020-07-15 17:46:53 +02:00
Pedro M. Baeza
2cafe7425a [FIX] contract: Proper is_recurring_note compute method
Before, the compute method had the same name as the field.
2020-07-15 17:40:31 +02:00
Jairo Llopis
4b1bfb8502 [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
2020-06-25 08:41:35 +01:00
Pedro M. Baeza
b3d64d300c [IMP] contract: Allow to set a manual currency
Done through an extra field + inverse in the existing compute. This way, we have
the flexibility of auto-remove custom value if it matches the computed one + we don't
need extra changes in the rest of the code.
2020-06-05 19:13:19 +02:00
Pedro M. Baeza
a12f0497f9 [FIX] contract: Currency is not editable + pricelist from partner
Previous related field was not accurated nor editable. Now the field is got
properly from a computed field.

Reviewing this, as the currency was taken (and it continues being taken) from the partner
pricelist if no pricelist is explicitly set, automatic price should use the same logic for
using partner pricelist.
2020-06-02 11:03:54 +02:00
sbejaoui
019ecefa51 [IMP] - Contract: add new recurring_rule_type quarterly and semesterly 2020-05-18 09:54:09 +02:00
Ernesto Tejeda
b66e388378 [FIX] contract: Select the correct sections/notes to be invoiced 2020-05-06 17:30:38 +02:00
Pedro M. Baeza
0712757fce [FIX+IMP] contract: improve test coverage with new sections + fix search method 2020-04-14 13:14:10 +02:00
Ernesto Tejeda
9291305c48 [IMP] contract: add section and notes in contract line 2020-04-13 18:16:08 +02:00
Stéphane Valaeys
22f84f5671 Set company_id earlier in the invoice preparation process so that _onchange_partner can execute as intended. 2020-03-23 14:06:06 +01:00
sbejaoui
e71fcc1694 [IMP] - use terminate term instead of resiliate 2020-03-11 11:13:13 +01:00
sbejaoui
be7c3527e9 [IMP] - track resiliation fields 2020-03-10 11:12:51 +01:00
sbejaoui
a638f59faf [IMP] - don't copy resiliate fields 2020-03-10 11:12:51 +01:00
sbejaoui
fa605544d9 [IMP] - resiliate comment required based on resiliation reason 2020-03-10 11:12:51 +01:00
sbejaoui
58b38490f6 [IMP] - contract resiliation 2020-03-10 11:11:59 +01:00
OCA-git-bot
737239cc9a Merge PR #412 into 12.0
Signed-off-by sbejaoui
2020-03-02 12:04:27 +00:00
Ernesto Tejeda
5b6f304355 [IMP] contract: add analytic_tag_ids field in contract lines 2020-02-28 10:51:01 -05:00
OCA-git-bot
4b4fb37022 Merge PR #456 into 12.0
Signed-off-by sbidoul
2020-01-30 08:31:21 +00:00
sbejaoui
29cc7cb23a [12.0][IMP] - Add an action for contracts manual invoicing
It happen that a company has to trigger the invoicing action to generate invoices before
the scheduled date (to print and prepare invoices documents, check invoices, etc.).
This requires technical access for end users with the risk that this represents.

This commit adds a new wizard to run the invoicing action for a given date with a helper
to see and check the contract that will be invoiced. When the manual action is called,
the system displays all created invoices.

[12.0][IMP] - log the manual invoice action in contract chatter

[IMP] - Add alink to the invoice in contract message at manual invoicing

[IMP] - Improve code

[FIX] - log message for invoice creation only when there is an invoice

[IMP] - split the manual invoice menu into to menus sale & purhcase

[IMP] - hide invoice button if there is nothing to invoice
2020-01-29 16:40:22 +01:00
Pedro M. Baeza
96d1abeb6c [IMP] contract: remove redundant method
I have detected a method that was created as redundant and with the same
technique used when preparing the line values, so better to have
everything together in the same method instead of having it spread.
2020-01-24 00:38:01 +01:00
OCA-git-bot
e54a2aaa52 Merge PR #422 into 12.0
Signed-off-by sbidoul
2020-01-17 10:47:25 +00:00
Pedro M. Baeza
acd45545fa [FIX] contract: Handle properly multi-company setups
If you have contracts in several companies, cron will create all of them, but
property fields will be populated with incorrect data as the taken company is
the main from the cron user (usually admin).
2020-01-08 18:46:05 +01:00
sbejaoui
33ccf301f6 [12.0][FIX] - stop update recurring_next_date 2020-01-07 13:22:44 +01:00