mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] contract: black, isort, prettier
This commit is contained in:
@@ -17,19 +17,19 @@ Recurring - Contracts Management
|
|||||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
:alt: License: AGPL-3
|
:alt: License: AGPL-3
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
|
||||||
:target: https://github.com/OCA/contract/tree/16.0/contract
|
:target: https://github.com/OCA/contract/tree/17.0/contract
|
||||||
:alt: OCA/contract
|
:alt: OCA/contract
|
||||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||||
:target: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract
|
:target: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-contract
|
||||||
:alt: Translate me on Weblate
|
:alt: Translate me on Weblate
|
||||||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
||||||
:target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=16.0
|
:target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=17.0
|
||||||
:alt: Try me on Runboat
|
:alt: Try me on Runboat
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
|
|
||||||
This module enables contracts management with recurring
|
This module enables contracts management with recurring invoicing
|
||||||
invoicing functions. Also you can print and send by email contract report.
|
functions. Also you can print and send by email contract report.
|
||||||
|
|
||||||
It works for customer contract and supplier contracts.
|
It works for customer contract and supplier contracts.
|
||||||
|
|
||||||
@@ -43,51 +43,65 @@ Contracts are shown in portal.
|
|||||||
Configuration
|
Configuration
|
||||||
=============
|
=============
|
||||||
|
|
||||||
To view discount field in contract line, you need to set *Discount on lines* in
|
To view discount field in contract line, you need to set *Discount on
|
||||||
user access rights.
|
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.
|
Contracts can be viewed on the portal (list and detail) if the user
|
||||||
|
logged into the portal is a follower of the contract.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|
||||||
#. Contracts are in Invoicing -> Customers -> Customer and Invoicing -> Vendors -> Supplier Contracts
|
1. Contracts are in Invoicing -> Customers -> Customer and Invoicing ->
|
||||||
#. When creating a contract, fill fields for selecting the invoicing parameters:
|
Vendors -> Supplier Contracts
|
||||||
|
2. When creating a contract, fill fields for selecting the invoicing
|
||||||
|
parameters:
|
||||||
|
|
||||||
* a journal
|
- a journal
|
||||||
* a price list (optional)
|
- a price list (optional)
|
||||||
|
|
||||||
#. And add the lines to be invoiced with:
|
3. And add the lines to be invoiced with:
|
||||||
|
|
||||||
* the product with a description, a quantity and a price
|
- the product with a description, a quantity and a price
|
||||||
* the recurrence parameters: interval (days, weeks, months, months last day or years),
|
- the recurrence parameters: interval (days, weeks, months, months
|
||||||
start date, date of next invoice (automatically computed, can be modified) and end date (optional)
|
last day or years), start date, date of next invoice
|
||||||
* auto-price, for having a price automatically obtained from the price list
|
(automatically computed, can be modified) and end date (optional)
|
||||||
* #START# or #END# in the description field to display the start/end date of
|
- auto-price, for having a price automatically obtained from the
|
||||||
the invoiced period in the invoice line description
|
price list
|
||||||
* pre-paid (invoice at period start) or post-paid (invoice at start of next period)
|
- #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.
|
4. The "Generate Recurring Invoices from Contracts" cron runs daily to
|
||||||
If you are in debug mode, you can click on the invoice creation button.
|
generate the invoices. If you are in debug mode, you can click on the
|
||||||
#. The *Show recurring invoices* shortcut on contracts shows all invoices created from the
|
invoice creation button.
|
||||||
contract.
|
5. The *Show recurring invoices* shortcut on contracts shows all
|
||||||
#. The contract report can be printed from the Print menu
|
invoices created from the contract.
|
||||||
#. The contract can be sent by email with the *Send by Email* button
|
6. The contract report can be printed from the Print menu
|
||||||
#. Contract templates can be created from the Configuration -> Contracts -> Contract Templates menu.
|
7. The contract can be sent by email with the *Send by Email* button
|
||||||
They allow to define default journal, price list and lines when creating a contract.
|
8. Contract templates can be created from the Configuration -> Contracts
|
||||||
To use it, just select the template on the contract and fields will be filled automatically.
|
-> 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:
|
- Contracts appear in portal to following users in every contract:
|
||||||
|
|
||||||
.. image:: https://raw.githubusercontent.com/OCA/contract/16.0/contract/static/src/screenshots/portal-my.png
|
|image|
|
||||||
.. image:: https://raw.githubusercontent.com/OCA/contract/16.0/contract/static/src/screenshots/portal-list.png
|
|
||||||
.. image:: https://raw.githubusercontent.com/OCA/contract/16.0/contract/static/src/screenshots/portal-detail.png
|
|image1|
|
||||||
|
|
||||||
|
|image2|
|
||||||
|
|
||||||
|
.. |image| image:: https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-my.png
|
||||||
|
.. |image1| image:: https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-list.png
|
||||||
|
.. |image2| image:: https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-detail.png
|
||||||
|
|
||||||
Known issues / Roadmap
|
Known issues / Roadmap
|
||||||
======================
|
======================
|
||||||
|
|
||||||
* Recover states and others functional fields in Contracts.
|
- Recover states and others functional fields in Contracts.
|
||||||
* Add recurrence flag at template level.
|
- Add recurrence flag at template level.
|
||||||
|
|
||||||
Bug Tracker
|
Bug Tracker
|
||||||
===========
|
===========
|
||||||
@@ -95,7 +109,7 @@ Bug Tracker
|
|||||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_.
|
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.
|
In case of trouble, please check there if your issue has already been reported.
|
||||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||||
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%2017.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.
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
@@ -103,33 +117,40 @@ Credits
|
|||||||
=======
|
=======
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
~~~~~~~
|
-------
|
||||||
|
|
||||||
* Tecnativa
|
* Tecnativa
|
||||||
* ACSONE SA/NV
|
* ACSONE SA/NV
|
||||||
|
|
||||||
Contributors
|
Contributors
|
||||||
~~~~~~~~~~~~
|
------------
|
||||||
|
|
||||||
* Angel Moya <angel.moya@domatix.com>
|
- Angel Moya <angel.moya@domatix.com>
|
||||||
* Dave Lasley <dave@laslabs.com>
|
|
||||||
* Miquel Raïch <miquel.raich@eficent.com>
|
|
||||||
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>
|
|
||||||
* Thomas Binsfeld <thomas.binsfeld@acsone.eu>
|
|
||||||
* Guillaume Vandamme <guillaume.vandamme@acsone.eu>
|
|
||||||
* Raphaël Reverdy <raphael.reverdy@akretion.com>
|
|
||||||
|
|
||||||
* `Tecnativa <https://www.tecnativa.com>`_:
|
- Dave Lasley <dave@laslabs.com>
|
||||||
|
|
||||||
* Pedro M. Baeza
|
- Miquel Raïch <miquel.raich@eficent.com>
|
||||||
* Carlos Dauden
|
|
||||||
* Vicent Cubells
|
- Souheil Bejaoui <souheil.bejaoui@acsone.eu>
|
||||||
* Rafael Blasco
|
|
||||||
* Víctor Martínez
|
- Thomas Binsfeld <thomas.binsfeld@acsone.eu>
|
||||||
* Iván Antón <ozono@ozonomultimedia.com>
|
|
||||||
|
- Guillaume Vandamme <guillaume.vandamme@acsone.eu>
|
||||||
|
|
||||||
|
- Raphaël Reverdy <raphael.reverdy@akretion.com>
|
||||||
|
|
||||||
|
- `Tecnativa <https://www.tecnativa.com>`__:
|
||||||
|
|
||||||
|
- Pedro M. Baeza
|
||||||
|
- Carlos Dauden
|
||||||
|
- Vicent Cubells
|
||||||
|
- Rafael Blasco
|
||||||
|
- Víctor Martínez
|
||||||
|
|
||||||
|
- Iván Antón <ozono@ozonomultimedia.com>
|
||||||
|
|
||||||
Maintainers
|
Maintainers
|
||||||
~~~~~~~~~~~
|
-----------
|
||||||
|
|
||||||
This module is maintained by the OCA.
|
This module is maintained by the OCA.
|
||||||
|
|
||||||
@@ -141,6 +162,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.
|
promote its widespread use.
|
||||||
|
|
||||||
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/16.0/contract>`_ project on GitHub.
|
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/17.0/contract>`_ project on GitHub.
|
||||||
|
|
||||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ from odoo import _, http
|
|||||||
from odoo.exceptions import AccessError, MissingError
|
from odoo.exceptions import AccessError, MissingError
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
|
|
||||||
from odoo.addons.portal.controllers.portal import CustomerPortal, pager as portal_pager
|
from odoo.addons.portal.controllers.portal import CustomerPortal
|
||||||
|
from odoo.addons.portal.controllers.portal import pager as portal_pager
|
||||||
|
|
||||||
|
|
||||||
class PortalContract(CustomerPortal):
|
class PortalContract(CustomerPortal):
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class ContractContract(models.Model):
|
|||||||
|
|
||||||
def _compute_access_url(self):
|
def _compute_access_url(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
record.access_url = "/my/contracts/{}".format(record.id)
|
record.access_url = f"/my/contracts/{record.id}"
|
||||||
|
|
||||||
def action_preview(self):
|
def action_preview(self):
|
||||||
"""Invoked when 'Preview' button in contract form view is clicked."""
|
"""Invoked when 'Preview' button in contract form view is clicked."""
|
||||||
|
|||||||
@@ -680,19 +680,16 @@ class ContractLine(models.Model):
|
|||||||
rec._prepare_value_for_stop(date_end, manual_renew_needed)
|
rec._prepare_value_for_stop(date_end, manual_renew_needed)
|
||||||
)
|
)
|
||||||
if post_message:
|
if post_message:
|
||||||
msg = (
|
msg = _(
|
||||||
_(
|
"""Contract line for <strong>%(product)s</strong>
|
||||||
"""Contract line for <strong>%(product)s</strong>
|
|
||||||
stopped: <br/>
|
stopped: <br/>
|
||||||
- <strong>End</strong>: %(old_end)s -- %(new_end)s
|
- <strong>End</strong>: %(old_end)s -- %(new_end)s
|
||||||
"""
|
"""
|
||||||
)
|
) % {
|
||||||
% {
|
"product": rec.name,
|
||||||
"product": rec.name,
|
"old_end": old_date_end,
|
||||||
"old_end": old_date_end,
|
"new_end": rec.date_end,
|
||||||
"new_end": rec.date_end,
|
}
|
||||||
}
|
|
||||||
)
|
|
||||||
rec.contract_id.message_post(body=msg)
|
rec.contract_id.message_post(body=msg)
|
||||||
else:
|
else:
|
||||||
rec.write(
|
rec.write(
|
||||||
@@ -757,21 +754,18 @@ class ContractLine(models.Model):
|
|||||||
rec.successor_contract_line_id = new_line
|
rec.successor_contract_line_id = new_line
|
||||||
contract_line |= new_line
|
contract_line |= new_line
|
||||||
if post_message:
|
if post_message:
|
||||||
msg = (
|
msg = _(
|
||||||
_(
|
"""Contract line for <strong>%(product)s</strong>
|
||||||
"""Contract line for <strong>%(product)s</strong>
|
|
||||||
planned a successor: <br/>
|
planned a successor: <br/>
|
||||||
- <strong>Start</strong>: %(new_date_start)s
|
- <strong>Start</strong>: %(new_date_start)s
|
||||||
<br/>
|
<br/>
|
||||||
- <strong>End</strong>: %(new_date_end)s
|
- <strong>End</strong>: %(new_date_end)s
|
||||||
"""
|
"""
|
||||||
)
|
) % {
|
||||||
% {
|
"product": rec.name,
|
||||||
"product": rec.name,
|
"new_date_start": new_line.date_start,
|
||||||
"new_date_start": new_line.date_start,
|
"new_date_end": new_line.date_end,
|
||||||
"new_date_end": new_line.date_end,
|
}
|
||||||
}
|
|
||||||
)
|
|
||||||
rec.contract_id.message_post(body=msg)
|
rec.contract_id.message_post(body=msg)
|
||||||
return contract_line
|
return contract_line
|
||||||
|
|
||||||
@@ -863,21 +857,18 @@ class ContractLine(models.Model):
|
|||||||
is_auto_renew,
|
is_auto_renew,
|
||||||
post_message=False,
|
post_message=False,
|
||||||
)
|
)
|
||||||
msg = (
|
msg = _(
|
||||||
_(
|
"""Contract line for <strong>%(product)s</strong>
|
||||||
"""Contract line for <strong>%(product)s</strong>
|
|
||||||
suspended: <br/>
|
suspended: <br/>
|
||||||
- <strong>Suspension Start</strong>: %(new_date_start)s
|
- <strong>Suspension Start</strong>: %(new_date_start)s
|
||||||
<br/>
|
<br/>
|
||||||
- <strong>Suspension End</strong>: %(new_date_end)s
|
- <strong>Suspension End</strong>: %(new_date_end)s
|
||||||
"""
|
"""
|
||||||
)
|
) % {
|
||||||
% {
|
"product": rec.name,
|
||||||
"product": rec.name,
|
"new_date_start": date_start,
|
||||||
"new_date_start": date_start,
|
"new_date_end": date_end,
|
||||||
"new_date_end": date_end,
|
}
|
||||||
}
|
|
||||||
)
|
|
||||||
rec.contract_id.message_post(body=msg)
|
rec.contract_id.message_post(body=msg)
|
||||||
return contract_line
|
return contract_line
|
||||||
|
|
||||||
@@ -1035,21 +1026,18 @@ class ContractLine(models.Model):
|
|||||||
else:
|
else:
|
||||||
new_line = rec._renew_extend_line(date_end)
|
new_line = rec._renew_extend_line(date_end)
|
||||||
res |= new_line
|
res |= new_line
|
||||||
msg = (
|
msg = _(
|
||||||
_(
|
"""Contract line for <strong>%(product)s</strong>
|
||||||
"""Contract line for <strong>%(product)s</strong>
|
|
||||||
renewed: <br/>
|
renewed: <br/>
|
||||||
- <strong>Start</strong>: %(new_date_start)s
|
- <strong>Start</strong>: %(new_date_start)s
|
||||||
<br/>
|
<br/>
|
||||||
- <strong>End</strong>: %(new_date_end)s
|
- <strong>End</strong>: %(new_date_end)s
|
||||||
"""
|
"""
|
||||||
)
|
) % {
|
||||||
% {
|
"product": rec.name,
|
||||||
"product": rec.name,
|
"new_date_start": date_start,
|
||||||
"new_date_start": date_start,
|
"new_date_end": date_end,
|
||||||
"new_date_end": date_end,
|
}
|
||||||
}
|
|
||||||
)
|
|
||||||
rec.contract_id.message_post(body=msg)
|
rec.contract_id.message_post(body=msg)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from odoo import api, fields, models
|
|||||||
|
|
||||||
|
|
||||||
class ContractModification(models.Model):
|
class ContractModification(models.Model):
|
||||||
|
|
||||||
_name = "contract.modification"
|
_name = "contract.modification"
|
||||||
_description = "Contract Modification"
|
_description = "Contract Modification"
|
||||||
_order = "date desc"
|
_order = "date desc"
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from odoo import fields, models
|
|||||||
|
|
||||||
|
|
||||||
class ContractTag(models.Model):
|
class ContractTag(models.Model):
|
||||||
|
|
||||||
_name = "contract.tag"
|
_name = "contract.tag"
|
||||||
_description = "Contract Tag"
|
_description = "Contract Tag"
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from odoo import fields, models
|
|||||||
|
|
||||||
|
|
||||||
class ContractTerminateReason(models.Model):
|
class ContractTerminateReason(models.Model):
|
||||||
|
|
||||||
_name = "contract.terminate.reason"
|
_name = "contract.terminate.reason"
|
||||||
_description = "Contract Termination Reason"
|
_description = "Contract Termination Reason"
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from odoo import fields, models
|
|||||||
|
|
||||||
|
|
||||||
class ResCompany(models.Model):
|
class ResCompany(models.Model):
|
||||||
|
|
||||||
_inherit = "res.company"
|
_inherit = "res.company"
|
||||||
|
|
||||||
create_new_line_at_contract_line_renew = fields.Boolean(
|
create_new_line_at_contract_line_renew = fields.Boolean(
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from odoo import fields, models
|
|||||||
|
|
||||||
|
|
||||||
class ResConfigSettings(models.TransientModel):
|
class ResConfigSettings(models.TransientModel):
|
||||||
|
|
||||||
_inherit = "res.config.settings"
|
_inherit = "res.config.settings"
|
||||||
|
|
||||||
create_new_line_at_contract_line_renew = fields.Boolean(
|
create_new_line_at_contract_line_renew = fields.Boolean(
|
||||||
|
|||||||
3
contract/pyproject.toml
Normal file
3
contract/pyproject.toml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["whool"]
|
||||||
|
build-backend = "whool.buildapi"
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
To view discount field in contract line, you need to set *Discount on lines* in
|
To view discount field in contract line, you need to set *Discount on
|
||||||
user access rights.
|
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.
|
Contracts can be viewed on the portal (list and detail) if the user
|
||||||
|
logged into the portal is a follower of the contract.
|
||||||
23
contract/readme/CONTRIBUTORS.md
Normal file
23
contract/readme/CONTRIBUTORS.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
- Angel Moya \<<angel.moya@domatix.com>\>
|
||||||
|
|
||||||
|
- Dave Lasley \<<dave@laslabs.com>\>
|
||||||
|
|
||||||
|
- Miquel Raïch \<<miquel.raich@eficent.com>\>
|
||||||
|
|
||||||
|
- Souheil Bejaoui \<<souheil.bejaoui@acsone.eu>\>
|
||||||
|
|
||||||
|
- Thomas Binsfeld \<<thomas.binsfeld@acsone.eu>\>
|
||||||
|
|
||||||
|
- Guillaume Vandamme \<<guillaume.vandamme@acsone.eu>\>
|
||||||
|
|
||||||
|
- Raphaël Reverdy \<<raphael.reverdy@akretion.com>\>
|
||||||
|
|
||||||
|
- [Tecnativa](https://www.tecnativa.com):
|
||||||
|
|
||||||
|
> - Pedro M. Baeza
|
||||||
|
> - Carlos Dauden
|
||||||
|
> - Vicent Cubells
|
||||||
|
> - Rafael Blasco
|
||||||
|
> - Víctor Martínez
|
||||||
|
|
||||||
|
- Iván Antón \<<ozono@ozonomultimedia.com>\>
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
* Angel Moya <angel.moya@domatix.com>
|
|
||||||
* Dave Lasley <dave@laslabs.com>
|
|
||||||
* Miquel Raïch <miquel.raich@eficent.com>
|
|
||||||
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>
|
|
||||||
* Thomas Binsfeld <thomas.binsfeld@acsone.eu>
|
|
||||||
* Guillaume Vandamme <guillaume.vandamme@acsone.eu>
|
|
||||||
* Raphaël Reverdy <raphael.reverdy@akretion.com>
|
|
||||||
|
|
||||||
* `Tecnativa <https://www.tecnativa.com>`_:
|
|
||||||
|
|
||||||
* Pedro M. Baeza
|
|
||||||
* Carlos Dauden
|
|
||||||
* Vicent Cubells
|
|
||||||
* Rafael Blasco
|
|
||||||
* Víctor Martínez
|
|
||||||
* Iván Antón <ozono@ozonomultimedia.com>
|
|
||||||
6
contract/readme/DESCRIPTION.md
Normal file
6
contract/readme/DESCRIPTION.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
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.
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
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.
|
|
||||||
2
contract/readme/ROADMAP.md
Normal file
2
contract/readme/ROADMAP.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
- Recover states and others functional fields in Contracts.
|
||||||
|
- Add recurrence flag at template level.
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
* Recover states and others functional fields in Contracts.
|
|
||||||
* Add recurrence flag at template level.
|
|
||||||
38
contract/readme/USAGE.md
Normal file
38
contract/readme/USAGE.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
1. Contracts are in Invoicing -\> Customers -\> Customer and Invoicing
|
||||||
|
-\> Vendors -\> Supplier Contracts
|
||||||
|
2. When creating a contract, fill fields for selecting the invoicing
|
||||||
|
parameters:
|
||||||
|
- a journal
|
||||||
|
- a price list (optional)
|
||||||
|
3. 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)
|
||||||
|
4. 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.
|
||||||
|
5. The *Show recurring invoices* shortcut on contracts shows all
|
||||||
|
invoices created from the contract.
|
||||||
|
6. The contract report can be printed from the Print menu
|
||||||
|
7. The contract can be sent by email with the *Send by Email* button
|
||||||
|
8. 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:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#. 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:: ../static/src/screenshots/portal-my.png
|
|
||||||
.. image:: ../static/src/screenshots/portal-list.png
|
|
||||||
.. image:: ../static/src/screenshots/portal-detail.png
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
<head>
|
<head>
|
||||||
@@ -368,9 +369,9 @@ ul.auto-toc {
|
|||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
!! source digest: sha256:0aeda9acaac627301a3132181f4e0e2fec4daa4e0c20194a82b2bab5b73afc80
|
!! source digest: sha256:0aeda9acaac627301a3132181f4e0e2fec4daa4e0c20194a82b2bab5b73afc80
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/contract/tree/16.0/contract"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/contract/tree/17.0/contract"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-contract"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||||
<p>This module enables contracts management with recurring
|
<p>This module enables contracts management with recurring invoicing
|
||||||
invoicing functions. Also you can print and send by email contract report.</p>
|
functions. Also you can print and send by email contract report.</p>
|
||||||
<p>It works for customer contract and supplier contracts.</p>
|
<p>It works for customer contract and supplier contracts.</p>
|
||||||
<p>Contracts are shown in portal.</p>
|
<p>Contracts are shown in portal.</p>
|
||||||
<p><strong>Table of contents</strong></p>
|
<p><strong>Table of contents</strong></p>
|
||||||
@@ -390,45 +391,53 @@ invoicing functions. Also you can print and send by email contract report.</p>
|
|||||||
</div>
|
</div>
|
||||||
<div class="section" id="configuration">
|
<div class="section" id="configuration">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
|
||||||
<p>To view discount field in contract line, you need to set <em>Discount on lines</em> in
|
<p>To view discount field in contract line, you need to set <em>Discount on
|
||||||
user access rights.</p>
|
lines</em> in user access rights.</p>
|
||||||
<p>Contracts can be viewed on the portal (list and detail) if the user logged into the portal is a follower of the contract.</p>
|
<p>Contracts can be viewed on the portal (list and detail) if the user
|
||||||
|
logged into the portal is a follower of the contract.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="usage">
|
<div class="section" id="usage">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
|
||||||
<ol class="arabic simple">
|
<ol class="arabic simple">
|
||||||
<li>Contracts are in Invoicing -> Customers -> Customer and Invoicing -> Vendors -> Supplier Contracts</li>
|
<li>Contracts are in Invoicing -> Customers -> Customer and Invoicing ->
|
||||||
<li>When creating a contract, fill fields for selecting the invoicing parameters:<ul>
|
Vendors -> Supplier Contracts</li>
|
||||||
|
<li>When creating a contract, fill fields for selecting the invoicing
|
||||||
|
parameters:<ul>
|
||||||
<li>a journal</li>
|
<li>a journal</li>
|
||||||
<li>a price list (optional)</li>
|
<li>a price list (optional)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>And add the lines to be invoiced with:<ul>
|
<li>And add the lines to be invoiced with:<ul>
|
||||||
<li>the product with a description, a quantity and a price</li>
|
<li>the product with a description, a quantity and a price</li>
|
||||||
<li>the recurrence parameters: interval (days, weeks, months, months last day or years),
|
<li>the recurrence parameters: interval (days, weeks, months, months
|
||||||
start date, date of next invoice (automatically computed, can be modified) and end date (optional)</li>
|
last day or years), start date, date of next invoice
|
||||||
<li>auto-price, for having a price automatically obtained from the price list</li>
|
(automatically computed, can be modified) and end date (optional)</li>
|
||||||
<li>#START# or #END# in the description field to display the start/end date of
|
<li>auto-price, for having a price automatically obtained from the
|
||||||
the invoiced period in the invoice line description</li>
|
price list</li>
|
||||||
<li>pre-paid (invoice at period start) or post-paid (invoice at start of next period)</li>
|
<li>#START# or #END# in the description field to display the start/end
|
||||||
|
date of the invoiced period in the invoice line description</li>
|
||||||
|
<li>pre-paid (invoice at period start) or post-paid (invoice at start
|
||||||
|
of next period)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>The “Generate Recurring Invoices from Contracts” cron runs daily to generate the invoices.
|
<li>The “Generate Recurring Invoices from Contracts” cron runs daily to
|
||||||
If you are in debug mode, you can click on the invoice creation button.</li>
|
generate the invoices. If you are in debug mode, you can click on the
|
||||||
<li>The <em>Show recurring invoices</em> shortcut on contracts shows all invoices created from the
|
invoice creation button.</li>
|
||||||
contract.</li>
|
<li>The <em>Show recurring invoices</em> shortcut on contracts shows all
|
||||||
|
invoices created from the contract.</li>
|
||||||
<li>The contract report can be printed from the Print menu</li>
|
<li>The contract report can be printed from the Print menu</li>
|
||||||
<li>The contract can be sent by email with the <em>Send by Email</em> button</li>
|
<li>The contract can be sent by email with the <em>Send by Email</em> button</li>
|
||||||
<li>Contract templates can be created from the Configuration -> Contracts -> Contract Templates menu.
|
<li>Contract templates can be created from the Configuration -> Contracts
|
||||||
They allow to define default journal, price list and lines when creating a contract.
|
-> Contract Templates menu. They allow to define default journal,
|
||||||
To use it, just select the template on the contract and fields will be filled automatically.</li>
|
price list and lines when creating a contract. To use it, just select
|
||||||
|
the template on the contract and fields will be filled automatically.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li>Contracts appear in portal to following users in every contract:</li>
|
<li>Contracts appear in portal to following users in every contract:</li>
|
||||||
</ul>
|
</ul>
|
||||||
<img alt="https://raw.githubusercontent.com/OCA/contract/16.0/contract/static/src/screenshots/portal-my.png" src="https://raw.githubusercontent.com/OCA/contract/16.0/contract/static/src/screenshots/portal-my.png" />
|
<p><img alt="image" src="https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-my.png" /></p>
|
||||||
<img alt="https://raw.githubusercontent.com/OCA/contract/16.0/contract/static/src/screenshots/portal-list.png" src="https://raw.githubusercontent.com/OCA/contract/16.0/contract/static/src/screenshots/portal-list.png" />
|
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-list.png" /></p>
|
||||||
<img alt="https://raw.githubusercontent.com/OCA/contract/16.0/contract/static/src/screenshots/portal-detail.png" src="https://raw.githubusercontent.com/OCA/contract/16.0/contract/static/src/screenshots/portal-detail.png" />
|
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-detail.png" /></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="known-issues-roadmap">
|
<div class="section" id="known-issues-roadmap">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
|
||||||
@@ -442,7 +451,7 @@ To use it, just select the template on the contract and fields will be filled au
|
|||||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>.
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>.
|
||||||
In case of trouble, please check there if your issue has already been reported.
|
In case of trouble, please check there if your issue has already been reported.
|
||||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||||
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="credits">
|
<div class="section" id="credits">
|
||||||
@@ -493,7 +502,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|||||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.</p>
|
promote its widespread use.</p>
|
||||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/16.0/contract">OCA/contract</a> project on GitHub.</p>
|
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/17.0/contract">OCA/contract</a> project on GitHub.</p>
|
||||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ class TestContractManuallyCreateInvoice(TestContractBase):
|
|||||||
cls.contract2.unlink()
|
cls.contract2.unlink()
|
||||||
|
|
||||||
def test_contract_manually_create_invoice(self):
|
def test_contract_manually_create_invoice(self):
|
||||||
|
|
||||||
contracts = self.contract
|
contracts = self.contract
|
||||||
for _i in range(10):
|
for _i in range(10):
|
||||||
contracts |= self.contract.copy()
|
contracts |= self.contract.copy()
|
||||||
@@ -47,7 +46,6 @@ class TestContractManuallyCreateInvoice(TestContractBase):
|
|||||||
self.assertEqual(len(invoices), contract_to_invoice_count)
|
self.assertEqual(len(invoices), contract_to_invoice_count)
|
||||||
|
|
||||||
def test_contract_manually_create_invoice_with_usererror(self):
|
def test_contract_manually_create_invoice_with_usererror(self):
|
||||||
|
|
||||||
contracts = self.contract
|
contracts = self.contract
|
||||||
|
|
||||||
accounts = self.product_1.product_tmpl_id.get_product_accounts()
|
accounts = self.product_1.product_tmpl_id.get_product_accounts()
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from odoo import fields, models
|
|||||||
|
|
||||||
|
|
||||||
class ContractContractTerminate(models.TransientModel):
|
class ContractContractTerminate(models.TransientModel):
|
||||||
|
|
||||||
_name = "contract.contract.terminate"
|
_name = "contract.contract.terminate"
|
||||||
_description = "Terminate Contract Wizard"
|
_description = "Terminate Contract Wizard"
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from odoo import fields, models
|
|||||||
|
|
||||||
|
|
||||||
class ContractLineWizard(models.TransientModel):
|
class ContractLineWizard(models.TransientModel):
|
||||||
|
|
||||||
_name = "contract.line.wizard"
|
_name = "contract.line.wizard"
|
||||||
_description = "Contract Line Wizard"
|
_description = "Contract Line Wizard"
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ from odoo.exceptions import (
|
|||||||
|
|
||||||
|
|
||||||
class ContractManuallyCreateInvoice(models.TransientModel):
|
class ContractManuallyCreateInvoice(models.TransientModel):
|
||||||
|
|
||||||
_name = "contract.manually.create.invoice"
|
_name = "contract.manually.create.invoice"
|
||||||
_description = "Contract Manually Create Invoice Wizard"
|
_description = "Contract Manually Create Invoice Wizard"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user