Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] contract: Migration to 16.0 #887

Merged
merged 226 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
e5b4679
[ADD] account_analytic_analysis_recurring
Feb 4, 2014
a9cada6
[IMP+FIX] Pot file and Dutch translation + PEP8
Jul 11, 2014
779540f
[IMP+FIX] account_analytic_analysis_recurring: Several things
pedrobaeza Aug 25, 2014
61df88f
[FIX] contract: Set correct company on invoices when working on multi…
Oct 24, 2014
a1f967f
[IMP] account_analytic_analysis_recurring: Hook method for preparing …
pedrobaeza Feb 12, 2015
0aa65b2
[MIG] contract: from v7 to v9 improving features
carlosdauden Mar 22, 2016
a703250
OCA Transbot updated translations from Transifex
oca-transbot Apr 2, 2016
6aadeaa
[9.0][IMP] contract: Get default invoice contact. (#32)
carlosdauden May 12, 2016
e552c83
[IMP+FIX] contract: Better README + category + assign contract uncond…
pedrobaeza Sep 8, 2016
aa9b253
OCA Transbot updated translations from Transifex
oca-transbot Sep 17, 2016
e65f660
[IMP] contract: Add past receipt type. Fix yearly. Add month last day
carlosdauden Sep 11, 2016
1e0352a
[MIG] contract: Migration to version 10.0
pedrobaeza Oct 6, 2016
1ae93d5
OCA Transbot updated translations from Transifex
oca-transbot Dec 10, 2016
30207c4
[IMP][10.0] contract: Add templating (#42)
lasley Apr 1, 2017
1022454
Add 'Date of Next Invoice' in contract list view
astirpe Apr 10, 2017
a232e13
OCA Transbot updated translations from Transifex
oca-transbot May 1, 2017
825b7a4
[FIX] contract: Operator issue in price get
lasley May 9, 2017
7753273
[IMP][10.0] contract: Add report + send by mail (#86)
cubells Aug 16, 2017
2f0c3ad
OCA Transbot updated translations from Transifex
oca-transbot Aug 19, 2017
48f1590
[FIX] contract: Template lines handling (#92)
lasley Sep 25, 2017
73f2ddd
[FIX] contract: fix views assignment + improvement on tests + copyrig…
pedrobaeza Aug 22, 2017
3d173b9
[IMP] contract: Module contract improvements (#107)
carlosdauden Nov 8, 2017
3b3ae8a
[IMP] contract: Add display sequence on contract lines (#119)
Nov 18, 2017
3c8f866
[MIG] contract: Migration to version 11.0
Nov 13, 2017
2252fe1
[IMP] contract: Menu position
pedrobaeza Nov 21, 2017
ad2a957
OCA Transbot updated translations from Transifex
oca-transbot Nov 25, 2017
3954c90
[10.0][FIX+IMP] contract: Improve usability and don't fail on wrong d…
pedrobaeza Dec 7, 2017
1fffe7a
OCA Transbot updated translations from Transifex
oca-transbot Dec 16, 2017
2ee02e0
[10.0][FIX] Correct domain attribute in field journal_id (#120)
gorozcoh Nov 19, 2017
590088d
[FIX+IMP] contract: Real fix to company_id missing + improvements + C…
pedrobaeza Nov 28, 2017
fe44f19
OCA Transbot updated translations from Transifex
oca-transbot Jan 6, 2018
a8fba7f
[IMP+FIX] contract: Several things:
carlosdauden Jan 17, 2018
4ec02ed
OCA Transbot updated translations from Transifex
oca-transbot Jan 27, 2018
6a7d445
[IMP] contract: Automatic prices for lines
pedrobaeza Dec 23, 2017
6541a80
[FIX] contract: Let billing users have access rights for contracts (#…
levkar Apr 1, 2018
70a545d
[IMP] contract: Add extend existing invoice possibility
carlosdauden Mar 28, 2018
6160b0b
OCA Transbot updated translations from Transifex
oca-transbot Apr 14, 2018
4c70e00
[IMP] contract_variable_quantity: Recompute price when changing qty
pedrobaeza Apr 24, 2018
e4ddec4
OCA Transbot updated translations from Transifex
oca-transbot Apr 28, 2018
1edf1bf
[FIX] contract: Custom values overwrited by xml, missed noupdate
carlosdauden Jun 13, 2018
152e83d
[UPD] Update contract.pot
oca-travis Jun 21, 2018
3957da4
[IMP] contract: possible error in migration if the column does not exist
jonerikceberio Jul 9, 2018
5363ac1
[FIX] analytic invoice/contract lines inheritance
katyukha Jun 26, 2018
8277dbc
[IMP] Fix README.rst
RoelAdriaans Jul 21, 2018
2ad9d5b
Translated using Weblate (Dutch)
RoelAdriaans Jul 29, 2018
4e30925
Translated using Weblate (German)
Aug 7, 2018
da498fd
[IMP] Add type to analytic account / contract
funbaker Sep 6, 2017
4aaaa45
[IMP] Make sure it works for sale and purchase contracts
MiquelRForgeFlow Jul 4, 2018
d9f0296
Translated using Weblate (German)
Aug 22, 2018
c3e4af8
Translated using Weblate (Spanish)
etobella Sep 18, 2018
ddad202
Translated using Weblate (Portuguese (Portugal))
dreispt Sep 23, 2018
99a529b
[IMP] contract: Don't depend on external data
pedrobaeza Sep 29, 2018
7c5d1e4
[FIX] Contract Spanish Translation
Oct 3, 2018
09684f1
[MIG] contract: Migration to 12.0
sbejaoui Oct 25, 2018
651be85
Translated using Weblate (German)
Oct 30, 2018
94ec4e2
Update translation files
oca-transbot Dec 9, 2018
4a37e3c
Translated using Weblate (Spanish)
mvrodriguez Feb 4, 2019
23aa88f
Translated using Weblate (Galician)
mvrodriguez Feb 4, 2019
4e308b9
Translated using Weblate (German)
marylla Feb 22, 2019
f709b89
Update translation files
oca-transbot Mar 3, 2019
346b24a
[ADD] icon.png
OCA-git-bot Apr 2, 2019
6b4286a
[FIX] Errors in navigation to customer invoices / vendor bills
JordiBForgeFlow Feb 4, 2019
79000c1
Translated using Weblate (Italian)
primes2h Jun 26, 2019
dcceeae
Translated using Weblate (French)
Jul 28, 2019
b625cfc
Translated using Weblate (Portuguese)
pedrocs-exo Aug 14, 2019
3471222
Translated using Weblate (Portuguese (Brazil))
Sep 3, 2019
9e3c0e1
Translated using Weblate (German)
rschnapka Sep 3, 2019
5215ebc
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 4, 2019
336fb45
Remove invalid Chinese translation files
liweijie0812 Sep 5, 2019
2e70174
[IMP] contract: Make recurrence mechanism on contract line
sbejaoui Oct 30, 2018
9d07a86
[REF+FIX+IMP] Contract: invoice creation + date start required for co…
ThomasBinsfeld Dec 18, 2018
36d4d0e
[FIX+IMP] contract: several things
sbejaoui Dec 20, 2018
3b694fd
[FIX] Contract: copy payment term on generated invoice
ThomasBinsfeld Jan 11, 2019
910abf8
[IMP] - Should be able to stop a past contract line
sbejaoui Jan 11, 2019
edcdafc
[ADD] Contract: fiscal position
ThomasBinsfeld Jan 16, 2019
62eaa9b
[FIX+IMP] contract: recurring_next_date is required if date_end is nu…
sbejaoui Jan 17, 2019
8ef0ed6
[IMP] Contract: matching invoice view depending on contract type
ThomasBinsfeld Jan 21, 2019
d2beafe
[ADD] - Add more value for auto_renew_rule_type
sbejaoui Jan 24, 2019
5a06f31
[FIX] Contract to Invoice: take contract vendor instead of partner's
ThomasBinsfeld Feb 20, 2019
06b4f25
[REF+FIX+IMP] contract: Several things
sbejaoui Feb 28, 2019
6e24d1d
[IMP]pass the payment term to the contract from the partner
AaronHForgeFlow May 28, 2019
a3f1cba
[REF] contract: Several things
ThomasBinsfeld May 28, 2019
5339342
[IMP] - Make one migration from 12.0.1 to 12.0.4
sbejaoui Jul 15, 2019
46830e1
[FIX+IMP+MIG] contract: Several refinements:
pedrobaeza Sep 13, 2019
171805b
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 17, 2019
010255e
[MIG+FIX] contract: Missing pieces for moving info from analytic acco…
pedrobaeza Sep 18, 2019
a76940b
Add commercial_partner_id fields into contract module
hparfr Aug 14, 2019
674d742
Translated using Weblate (Italian)
eLBati Oct 8, 2019
6f902d5
[MIG] contract: Assign old partner's salesman to migrated contracts
pedrobaeza Oct 8, 2019
d361cf4
Translated using Weblate (German)
marylla Oct 9, 2019
fb1005b
[12.0][FIX] contract & contract_sale - security fix
enriquemartin Oct 9, 2019
d54609e
Translated using Weblate (Catalan)
albertpons Oct 9, 2019
43584ea
Translated using Weblate (Portuguese (Brazil))
britoederr Oct 10, 2019
d49b5d7
[MIG] contract: Missing renaming of invoice link
pedrobaeza Oct 15, 2019
0d0f1c8
Translated using Weblate (Chinese (Simplified))
liweijie0812 Oct 16, 2019
b3b393e
[MIG] contract: Create contract sequence for allowing to create records
pedrobaeza Oct 23, 2019
2498938
Translated using Weblate (Dutch)
thomaspot Oct 23, 2019
86bf9b2
[IMP+FIX] contract: Add multi-company access rule for contract object…
sbejaoui Oct 25, 2019
9c93cc8
Translated using Weblate (German)
rschnapka Oct 29, 2019
35e782e
Translated using Weblate (Spanish)
josepmy Oct 29, 2019
0964de5
[FIX] contract: Fix performance issue on contract line read + Fix con…
sbejaoui Oct 30, 2019
9951bd0
[MIG] contract: No contract on AA without recurring invoices flag
pedrobaeza Nov 11, 2019
8e408ae
Translated using Weblate (Croatian)
badbole Nov 12, 2019
2bef337
[IMP] contract: Fix test crash with other modules
sergio-teruel Nov 14, 2019
c090760
[MIG][FIX] contract: Move contracts, but disable them
pedrobaeza Nov 18, 2019
7962308
Translated using Weblate (Croatian)
badbole Dec 2, 2019
440d83e
[12.0][FIX] - Run onchange contract_type when changing the contract t…
sbejaoui Nov 26, 2019
a9ed053
[FIX] contract: Don't execute onchange after invoice creation + Tests…
pedrobaeza Dec 2, 2019
a0b85a2
[REF] contract: Several refactorings
sbidoul Dec 6, 2019
04bd78f
Translated using Weblate (French)
Martronic-SA Dec 6, 2019
3afddee
[REF+FIX+IMP] contract: Several refactorings + fixes + imps
sbidoul Dec 6, 2019
2fab07b
[FIX+REF] contract: Improve unit tests + add unit test for different …
sbejaoui Dec 9, 2019
ab4cc4d
[IMP] contract: display invoicing offset
sbidoul Dec 9, 2019
990ea36
Translated using Weblate (Portuguese (Brazil))
augustodinizl Dec 16, 2019
ddd6bfb
[IMP+FIX] contract: Several things
sbejaoui Dec 21, 2019
9cca8b8
Translated using Weblate (Italian)
scigghia Dec 26, 2019
d107eb8
Update translation files
oca-transbot Jan 2, 2020
d8e86ae
[IMP+FIX] contract: Add failing test for wrong invoicing date after c…
sbejaoui Dec 19, 2019
63d36f1
[FIX] contract: Handle properly multi-company setups
pedrobaeza Jan 8, 2020
9c0d92d
Translated using Weblate (French)
gregory-moka Jan 9, 2020
afad88d
Update translation files
oca-transbot Jan 9, 2020
e2bdbfa
Added translation using Weblate (Spanish (Chile))
Jan 17, 2020
00ab811
Translated using Weblate (Spanish)
Jan 17, 2020
b19c5e1
Update translation files
oca-transbot Jan 17, 2020
bc5f535
Translated using Weblate (French)
qgroulard Jan 21, 2020
36bf720
[IMP] contract: remove redundant method
pedrobaeza Jan 8, 2020
946f2e2
[12.0][IMP] - Add an action for contracts manual invoicing
sbejaoui Nov 13, 2019
c057bbc
Translated using Weblate (Italian)
Feb 4, 2020
5bdfcdd
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 12, 2020
2324f74
Translated using Weblate (Finnish)
jarmokortetjarvi Feb 13, 2020
fe2a171
Translated using Weblate (Portuguese)
pedrocs-exo Feb 17, 2020
1e101ae
Update translation files
oca-transbot Feb 20, 2020
4e6f1cf
Translated using Weblate (Finnish)
jarmokortetjarvi Feb 26, 2020
a813ae7
[IMP] contract: add analytic_tag_ids field in contract lines
Feb 28, 2020
9e364ef
[IMP] contract: Improve partner With running contracts search view fi…
sbejaoui Feb 12, 2020
cfaf10b
Translated using Weblate (French)
svalaeys Mar 17, 2020
00040da
[IMP] - Add contract tags
sbejaoui Oct 24, 2019
060a2e5
Set company_id earlier in the invoice preparation process so that _on…
svalaeys Mar 23, 2020
058dd85
Translated using Weblate (Spanish)
Mar 25, 2020
be4904b
[FIX] contract: Delete cascade line wizard
pedrobaeza Apr 1, 2020
c51ac90
[IMP] - Place id attribute before model
sbejaoui Apr 2, 2020
69df8ed
[IMP] contract: add section and notes in contract line
Mar 17, 2020
9d35873
[FIX+IMP] contract: improve test coverage with new sections + fix sea…
pedrobaeza Apr 14, 2020
a1e5546
Translated using Weblate (German)
marylla May 6, 2020
63f98fd
[FIX] contract: Select the correct sections/notes to be invoiced
Apr 28, 2020
0bb1991
[IMP] - Contract: add new recurring_rule_type quarterly and semesterly
sbejaoui Apr 14, 2020
23e41c1
Translated using Weblate (Spanish)
JorgeQuinteros May 21, 2020
e74cc4c
[FIX] contract: Currency is not editable + pricelist from partner
pedrobaeza Jun 2, 2020
e51eb88
Translated using Weblate (Portuguese (Brazil))
fcolus Jun 16, 2020
543b6d3
Translated using Weblate (Spanish)
pedrobaeza Jun 17, 2020
e94ff8b
[FIX] contract: do not die if modified partner has contracts in sever…
Jun 25, 2020
cdce701
[IMP] contract: Allow to set a manual currency
pedrobaeza Jun 5, 2020
1c6bfdb
Translated using Weblate (Slovenian)
sysadminmatmoz Jun 30, 2020
4e570bd
[FIX] contract: multi-company assignment notification
Jul 28, 2020
7051ca7
[12.0][FIX] - fiscal position, payment mode and pricelist obtained ac…
sbejaoui Aug 17, 2020
1e66a22
[IMP] : black, isort, prettier
pedrobaeza Jul 13, 2020
23046b0
[MIG] contract: Migration to 13.0
pedrobaeza Jul 14, 2020
cdec77e
[IMP+REF] contract: Allow to set recurrency at header level
pedrobaeza Jul 14, 2020
8f7d244
[13.0][FIX] contract: Recompute recurring next date
rousseldenis Sep 9, 2020
6c4d8b7
[IMP] contract: Set a condicion to avoid create lines on invoices
CarlosRoca13 Oct 28, 2020
04639a5
[FIX] contract: Only include 'section_and_note_one2many' js widget in…
victoralmau Nov 4, 2020
06ccb03
Translated using Weblate (Spanish (Argentina))
ibuioli Nov 22, 2020
5f2e61b
[IMP] contract: Add followers to invoices created
victoralmau Nov 30, 2020
7505712
Translated using Weblate (Dutch)
bosd Dec 15, 2020
f6f79aa
Translated using Weblate (Spanish (Argentina))
ibuioli Dec 22, 2020
5f20736
[IMP] contract: Portal
victoralmau Dec 16, 2020
a3275a7
[IMP] contract: JS tour on test assets
pedrobaeza Dec 25, 2020
632ef42
[IMP] contract: Add contract modification + contract: Add fields to c…
victoralmau Dec 28, 2020
826a578
Translated using Weblate (Spanish (Argentina))
ibuioli Jan 10, 2021
9d4a80b
[FIX] contract: Modification mail + Auto-create follower in contract …
victoralmau Jan 4, 2021
d17960d
[13.0][FIX] contract: Impossible to create invoices from contract lin…
rousseldenis Jan 31, 2021
652c34d
[FIX] contract: Error in test_contract_invoice_followers
victoralmau Feb 2, 2021
45ab1aa
[FIX] contract: remove groupby if it is in context + consistency betw…
Feb 15, 2021
b90a42d
[13.0][FIX] contract: consistency between contract count and contract…
newtratip Feb 23, 2021
354aa74
[OU-FIX] contract: Don't alter v12 recurrence mechanism + Transfer co…
pedrobaeza Feb 27, 2021
080bcef
[FIX] contract: Changed modification_mail auto to appear like email a…
victoralmau Mar 17, 2021
ae6a817
[IMP] contract: black, isort, prettier
ozono Apr 1, 2021
86ed1e1
[MIG] contract: Migration to 14.0
ozono Apr 2, 2021
ffa0d6b
[FIX] contract: restore readme images
ozono Apr 4, 2021
a65c28f
Added translation using Weblate (French (France))
Yvesldff Apr 11, 2021
a1679b5
Translated using Weblate (Dutch)
bosd Apr 18, 2021
388cee3
[FIX] contract: Don't change period start date having line recurrence
pedrobaeza May 18, 2021
b79b83f
[13.0][FIX] contract: Set layout for section and note in portal template
rousseldenis Apr 30, 2021
e72f0fc
[IMP] contract: Improve code to show recurring_rule_type from contrac…
victoralmau May 24, 2021
e32cf60
Translated using Weblate (Spanish (Argentina))
ibuioli May 30, 2021
a2815a1
contract 14.0.1.2.0
OCA-git-bot Jun 10, 2021
98fb160
Update translation files
oca-transbot Jun 10, 2021
964f3e5
Translated using Weblate (Spanish (Argentina))
ibuioli Jun 14, 2021
29165e2
[FIX] contract: Cleanup values on line when invoicing
pedrobaeza Jul 1, 2021
b465907
Translated using Weblate (Turkish)
tate11 Aug 5, 2021
150fa46
[FIX] contract: fix an obvious crash when self is a multi-recordset
alexis-via Aug 30, 2021
052b345
[FIX] contract: Fix invoice creation and salesperson assignment
joao-p-marques Sep 10, 2021
507b40e
Translated using Weblate (Catalan)
pere-aquarian Sep 13, 2021
8ce3152
Translated using Weblate (Portuguese)
pedrocs-exo Oct 25, 2021
7f620ee
[IMP] contract: black, isort, prettier
jcdrubay Oct 28, 2021
2cae776
[MIG] contract: Migration to 15.0
jcdrubay Oct 28, 2021
fbc37b5
[FIX] contract: Avoid error in invoicing contracts crone
manuelregidor Oct 29, 2021
804ee2f
[15.0][IMP] modify production beta to stable
JoanMForgeFlow Jan 25, 2022
0bc5082
[IMP] contract: Add discount + price_subtotal fields to the contract …
victoralmau Jan 25, 2022
d673af7
ADJ: When generating invoices from the Wizard to create invoices manu…
jcdrubay Feb 11, 2022
0212352
Translated using Weblate (Catalan)
Noel000 Feb 25, 2022
84ecec6
Translated using Weblate (Spanish (Argentina))
ibuioli Feb 26, 2022
0e3fbeb
[FIX+IMP] contract: Several things
rousseldenis Feb 25, 2022
e41bfe3
[IMP] update dotfiles [ci skip]
OCA-git-bot Mar 30, 2022
a9220f2
Translated using Weblate (Catalan)
juliap98 Apr 7, 2022
d8f90f2
Translated using Weblate (Turkish)
tate11 Apr 19, 2022
e230ba9
[FIX] contract: add default_move_type in context
mariadforgeflow May 23, 2022
5261c62
[FIX+IMP] contract: lots of things
rousseldenis Nov 3, 2021
9d17314
[FIX] contract: change where security is given to group_account_invoi…
albariera Oct 7, 2021
2863993
[FIX] contract: Remove noupdate in mail template data
joao-p-marques Jun 7, 2021
7bf498c
Translated using Weblate (Spanish (Argentina))
ibuioli Jun 29, 2022
3390020
Translated using Weblate (French)
gregory-moka Jul 4, 2022
ad929e2
[15.0][IMP] contract : show tags with colors in the contract
chandni299 Jul 27, 2022
bbfd083
Translated using Weblate (Spanish (Argentina))
ibuioli Aug 2, 2022
aca5577
Translated using Weblate (French)
gregory-moka Aug 17, 2022
a1b055a
Translated using Weblate (German)
wpichler Aug 22, 2022
56f4b44
[IMP] contract: Use _prepare_home_portal_values() function.
victoralmau Sep 2, 2022
c4b6167
Translated using Weblate (Portuguese (Brazil))
douglascstd Sep 26, 2022
e4a8461
Translated using Weblate (Spanish)
pere-aquarian Oct 10, 2022
d381d11
[IMP] contract: Set invoice_user_id field with Form() to apply the co…
victoralmau Oct 18, 2022
e79298d
[IMP] Add link to contract in invoice chatter
Sep 21, 2022
1a9a2fd
[FIX] contract: bug onchange date_start (comparison between bool and …
mourad-ehm May 13, 2022
8c00427
[IMP] contract: Set fixed start dates in test contracts
victoralmau Dec 1, 2022
8c269f0
[FIX] contract: Switch string > title in buttons
pedrobaeza Nov 3, 2022
c72ead9
[IMP] contract: pre-commit stuff
wpichler Oct 24, 2022
10e9287
[MIG] contract: Migration to 16.0
wpichler Oct 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions contract/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
================================
Recurring - Contracts Management
================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/15.0/contract
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-15-0/contract-15-0-contract
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/110/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module enables contracts management with recurring
invoicing functions. Also you can print and send by email contract report.

It works for customer contract and supplier contracts.

Contracts are shown in portal.

**Table of contents**

.. contents::
:local:

Configuration
=============

To view discount field in contract line, you need to set *Discount on lines* in
user access rights.

Contracts can be viewed on the portal (list and detail) if the user logged into the portal is a follower of the contract.

Usage
=====

#. Contracts are in Invoicing -> Customers -> Customer and Invoicing -> Vendors -> Supplier Contracts
#. When creating a contract, fill fields for selecting the invoicing parameters:

* a journal
* a price list (optional)

#. And add the lines to be invoiced with:

* the product with a description, a quantity and a price
* the recurrence parameters: interval (days, weeks, months, months last day or years),
start date, date of next invoice (automatically computed, can be modified) and end date (optional)
* auto-price, for having a price automatically obtained from the price list
* #START# or #END# in the description field to display the start/end date of
the invoiced period in the invoice line description
* pre-paid (invoice at period start) or post-paid (invoice at start of next period)

#. The "Generate Recurring Invoices from Contracts" cron runs daily to generate the invoices.
If you are in debug mode, you can click on the invoice creation button.
#. The *Show recurring invoices* shortcut on contracts shows all invoices created from the
contract.
#. The contract report can be printed from the Print menu
#. The contract can be sent by email with the *Send by Email* button
#. Contract templates can be created from the Configuration -> Contracts -> Contract Templates menu.
They allow to define default journal, price list and lines when creating a contract.
To use it, just select the template on the contract and fields will be filled automatically.

* Contracts appear in portal to following users in every contract:

.. image:: https://raw.githubusercontent.com/OCA/contract/15.0/contract/static/src/screenshots/portal-my.png
.. image:: https://raw.githubusercontent.com/OCA/contract/15.0/contract/static/src/screenshots/portal-list.png
.. image:: https://raw.githubusercontent.com/OCA/contract/15.0/contract/static/src/screenshots/portal-detail.png

Known issues / Roadmap
======================

* Recover states and others functional fields in Contracts.
* Add recurrence flag at template level.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Tecnativa
* ACSONE SA/NV

Contributors
~~~~~~~~~~~~

* Angel Moya <[email protected]>
* Dave Lasley <[email protected]>
* Miquel Raïch <[email protected]>
* Souheil Bejaoui <[email protected]>
* Thomas Binsfeld <[email protected]>
* Guillaume Vandamme <[email protected]>
* Raphaël Reverdy <[email protected]>

* `Tecnativa <https://www.tecnativa.com>`_:

* Pedro M. Baeza
* Carlos Dauden
* Vicent Cubells
* Rafael Blasco
* Víctor Martínez
* Iván Antón <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/15.0/contract>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions contract/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import controllers
from . import models
from . import wizards
58 changes: 58 additions & 0 deletions contract/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2004-2010 OpenERP SA
# Copyright 2014-2018 Tecnativa - Pedro M. Baeza
# Copyright 2015 Domatix
# Copyright 2016-2018 Tecnativa - Carlos Dauden
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2016-2017 LasLabs Inc.
# Copyright 2018-2019 ACSONE SA/NV
# Copyright 2020-2021 Tecnativa - Pedro M. Baeza
# Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Recurring - Contracts Management",
"version": "16.0.1.0.0",
"category": "Contract Management",
"license": "AGPL-3",
"author": "Tecnativa, ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/contract",
"depends": ["base", "account", "product", "portal"],
"development_status": "Production/Stable",
"external_dependencies": {"python": ["dateutil"]},
"data": [
"security/groups.xml",
"security/contract_tag.xml",
"security/ir.model.access.csv",
"security/contract_security.xml",
"security/contract_terminate_reason.xml",
"report/report_contract.xml",
"report/contract_views.xml",
"data/contract_cron.xml",
"data/contract_renew_cron.xml",
"data/mail_template.xml",
"data/template_mail_notification.xml",
"data/mail_message_subtype.xml",
"data/ir_ui_menu.xml",
"wizards/contract_line_wizard.xml",
"wizards/contract_manually_create_invoice.xml",
"wizards/contract_contract_terminate.xml",
"views/contract_tag.xml",
"views/abstract_contract_line.xml",
"views/contract.xml",
"views/contract_line.xml",
"views/contract_template.xml",
"views/contract_template_line.xml",
"views/res_partner_view.xml",
"views/res_config_settings.xml",
"views/contract_terminate_reason.xml",
"views/contract_portal_templates.xml",
],
"assets": {
"web.assets_backend": [
"contract/static/src/js/section_and_note_fields_backend.js",
],
"web.assets_frontend": ["contract/static/src/scss/frontend.scss"],
"web.assets_tests": ["contract/static/src/js/contract_portal_tour.js"],
},
"installable": True,
}
3 changes: 3 additions & 0 deletions contract/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import main
106 changes: 106 additions & 0 deletions contract/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Copyright 2020-2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, http
from odoo.exceptions import AccessError, MissingError
from odoo.http import request

from odoo.addons.portal.controllers.portal import CustomerPortal, pager as portal_pager


class PortalContract(CustomerPortal):
def _prepare_home_portal_values(self, counters):
values = super()._prepare_home_portal_values(counters)
if "contract_count" in counters:
contract_model = request.env["contract.contract"]
contract_count = (
contract_model.search_count([])
if contract_model.check_access_rights("read", raise_exception=False)
else 0
)
values["contract_count"] = contract_count
return values

def _contract_get_page_view_values(self, contract, access_token, **kwargs):
values = {
"page_name": "Contracts",
"contract": contract,
}
return self._get_page_view_values(
contract, access_token, values, "my_contracts_history", False, **kwargs
)

def _get_filter_domain(self, kw):
return []

@http.route(
["/my/contracts", "/my/contracts/page/<int:page>"],
type="http",
auth="user",
website=True,
)
def portal_my_contracts(
self, page=1, date_begin=None, date_end=None, sortby=None, **kw
):
values = self._prepare_portal_layout_values()
contract_obj = request.env["contract.contract"]
# Avoid error if the user does not have access.
if not contract_obj.check_access_rights("read", raise_exception=False):
return request.redirect("/my")
domain = self._get_filter_domain(kw)
searchbar_sortings = {
"date": {"label": _("Date"), "order": "recurring_next_date desc"},
"name": {"label": _("Name"), "order": "name desc"},
"code": {"label": _("Reference"), "order": "code desc"},
}
# default sort by order
if not sortby:
sortby = "date"
order = searchbar_sortings[sortby]["order"]
# count for pager
contract_count = contract_obj.search_count(domain)
# pager
pager = portal_pager(
url="/my/contracts",
url_args={
"date_begin": date_begin,
"date_end": date_end,
"sortby": sortby,
},
total=contract_count,
page=page,
step=self._items_per_page,
)
# content according to pager and archive selected
contracts = contract_obj.search(
domain, order=order, limit=self._items_per_page, offset=pager["offset"]
)
request.session["my_contracts_history"] = contracts.ids[:100]
values.update(
{
"date": date_begin,
"contracts": contracts,
"page_name": "Contracts",
"pager": pager,
"default_url": "/my/contracts",
"searchbar_sortings": searchbar_sortings,
"sortby": sortby,
}
)
return request.render("contract.portal_my_contracts", values)

@http.route(
["/my/contracts/<int:contract_contract_id>"],
type="http",
auth="public",
website=True,
)
def portal_my_contract_detail(self, contract_contract_id, access_token=None, **kw):
try:
contract_sudo = self._document_check_access(
"contract.contract", contract_contract_id, access_token
)
except (AccessError, MissingError):
return request.redirect("/my")
values = self._contract_get_page_view_values(contract_sudo, access_token, **kw)
return request.render("contract.portal_contract_page", values)
14 changes: 14 additions & 0 deletions contract/data/contract_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record model="ir.cron" id="contract_cron_for_invoice">
<field name="name">Generate Recurring Invoices from Contracts</field>
<field name="model_id" ref="model_contract_contract" />
<field name="state">code</field>
<field name="code">model.cron_recurring_create_invoice()</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
</record>
</odoo>
14 changes: 14 additions & 0 deletions contract/data/contract_renew_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record model="ir.cron" id="contract_line_cron_for_renew">
<field name="name">Renew Contract lines</field>
<field name="model_id" ref="model_contract_line" />
<field name="state">code</field>
<field name="code">model.cron_renew_contract_line()</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
</record>
</odoo>
9 changes: 9 additions & 0 deletions contract/data/ir_ui_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<menuitem
id="menu_config_contract"
name="Contracts"
sequence="1"
parent="account.menu_finance_configuration"
/>
</odoo>
15 changes: 15 additions & 0 deletions contract/data/mail_message_subtype.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="mail_message_subtype_invoice_created" model="mail.message.subtype">
<field name="name">Invoice created</field>
<field name="res_model">contract.contract</field>
</record>
<record
id="mail_message_subtype_contract_modification"
model="mail.message.subtype"
>
<field name="name">Contract modifications</field>
<field name="res_model">contract.contract</field>
<field name="default" eval="False" />
</record>
</odoo>
Loading