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

[12.0][MIG] - Migration module contract to 12.0 #202

Merged
merged 59 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
5dded23
[ADD] account_analytic_analysis_recurring
Feb 4, 2014
9ee057e
[IMP+FIX] Pot file and Dutch translation + PEP8
Jul 11, 2014
b4a4076
[IMP+FIX] account_analytic_analysis_recurring: Several things
pedrobaeza Aug 25, 2014
d2d9c9b
[FIX] contract: Set correct company on invoices when working on multi…
fedexin40 Oct 24, 2014
aaaa273
[IMP] account_analytic_analysis_recurring: Hook method for preparing …
pedrobaeza Feb 12, 2015
ea71777
[MIG] contract: from v7 to v9 improving features
carlosdauden Mar 22, 2016
bb5be71
OCA Transbot updated translations from Transifex
oca-transbot Apr 2, 2016
098e80e
[9.0][IMP] contract: Get default invoice contact. (#32)
carlosdauden May 12, 2016
bf61bc3
[IMP+FIX] contract: Better README + category + assign contract uncond…
pedrobaeza Sep 8, 2016
3eb60d5
OCA Transbot updated translations from Transifex
oca-transbot Sep 17, 2016
a22ce7b
[IMP] contract: Add past receipt type. Fix yearly. Add month last day
carlosdauden Sep 11, 2016
37d2f3d
[MIG] contract: Migration to version 10.0
pedrobaeza Oct 6, 2016
eef2c2f
OCA Transbot updated translations from Transifex
oca-transbot Dec 10, 2016
dcf3ff0
[IMP][10.0] contract: Add templating (#42)
lasley Apr 1, 2017
81c8b9a
Add 'Date of Next Invoice' in contract list view
astirpe Apr 10, 2017
af2fbb8
OCA Transbot updated translations from Transifex
oca-transbot May 1, 2017
f069dc9
[FIX] contract: Operator issue in price get
lasley May 9, 2017
629c224
[IMP][10.0] contract: Add report + send by mail (#86)
cubells Aug 16, 2017
6b8e6de
OCA Transbot updated translations from Transifex
oca-transbot Aug 19, 2017
7a644fd
[FIX] contract: Template lines handling (#92)
lasley Sep 25, 2017
fccb967
[FIX] contract: fix views assignment + improvement on tests + copyrig…
pedrobaeza Aug 22, 2017
684fda7
[IMP] contract: Module contract improvements (#107)
carlosdauden Nov 8, 2017
2bb7d9d
[IMP] contract: Add display sequence on contract lines (#119)
pedrocasi Nov 18, 2017
a74abc5
[MIG] contract: Migration to version 11.0
Nov 13, 2017
a750d06
[IMP] contract: Menu position
pedrobaeza Nov 21, 2017
5a54cfd
OCA Transbot updated translations from Transifex
oca-transbot Nov 25, 2017
9c3bf1c
[10.0][FIX+IMP] contract: Improve usability and don't fail on wrong d…
pedrobaeza Dec 7, 2017
680fe07
OCA Transbot updated translations from Transifex
oca-transbot Dec 16, 2017
fc66a63
[10.0][FIX] Correct domain attribute in field journal_id (#120)
gorozcoh Nov 19, 2017
cb146a3
[FIX+IMP] contract: Real fix to company_id missing + improvements
pedrobaeza Nov 28, 2017
ae0bd20
[FIX] contract: Correct references in the contract report
pedrobaeza Jan 3, 2018
a808ff1
OCA Transbot updated translations from Transifex
oca-transbot Jan 6, 2018
620cbd0
[IMP+FIX] contract: Several things:
carlosdauden Jan 17, 2018
c618c67
OCA Transbot updated translations from Transifex
oca-transbot Jan 27, 2018
9a9e35a
[IMP] contract: Automatic prices for lines
pedrobaeza Dec 23, 2017
80e778f
[FIX] contract: Let billing users have access rights for contracts (#…
levkar Apr 1, 2018
cd32e53
[IMP] contract: Add extend existing invoice possibility
carlosdauden Mar 28, 2018
354ba9f
OCA Transbot updated translations from Transifex
oca-transbot Apr 14, 2018
969ba60
[IMP] contract_variable_quantity: Recompute price when changing qty
pedrobaeza Apr 24, 2018
2cfd371
OCA Transbot updated translations from Transifex
oca-transbot Apr 28, 2018
67e7056
[FIX] contract: Custom values overwrited by xml, missed noupdate
carlosdauden Jun 13, 2018
9e3fdbe
[UPD] Update contract.pot
oca-travis Jun 21, 2018
0778774
[IMP] contract: possible error in migration if the column does not exist
jonerikceberio Jul 9, 2018
d5b9056
[FIX] analytic invoice/contract lines inheritance
katyukha Jun 26, 2018
3080d83
Rename account_analytic_*_line files
katyukha Jul 12, 2018
aebd79f
[UPD] Update contract.pot
oca-travis Jul 16, 2018
1df7b5a
[IMP] Fix README.rst
RoelAdriaans Jul 21, 2018
9d083fd
Translated using Weblate (Dutch)
RoelAdriaans Jul 29, 2018
aa19a15
Translated using Weblate (German)
Aug 7, 2018
3cc3c00
[IMP] Add type to analytic account / contract
funbaker Sep 6, 2017
669249a
[IMP] Make sure it works for sale and purchase contracts
MiquelRForgeFlow Jul 4, 2018
bc61b8d
[UPD] Update contract.pot
oca-travis Aug 22, 2018
7fba98d
Translated using Weblate (German)
Aug 22, 2018
69167cb
[UPD] README.rst
OCA-git-bot Aug 24, 2018
91de64f
Translated using Weblate (Spanish)
etobella Sep 18, 2018
cfd0ba5
Translated using Weblate (Portuguese (Portugal))
dreispt Sep 23, 2018
82a5130
[IMP] contract: Don't depend on external data
pedrobaeza Sep 29, 2018
2c5fe1b
[FIX] Contract Spanish Translation
Oct 3, 2018
12ac4e1
[MIG] contract: Migration to 12.0
sbejaoui Oct 25, 2018
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
126 changes: 126 additions & 0 deletions contract/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
================================
Contracts Management - Recurring
================================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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/11.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-11-0/contract-11-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/11.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.

**Table of contents**

.. contents::
:local:

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

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

Usage
=====

To use this module, you need to:

#. Go to Accounting -> Contracts and select or create a new contract.
#. Check *Generate recurring invoices automatically*.
#. Fill fields for selecting the recurrency and invoice parameters:

* Journal
* Pricelist
* Period. It can be any interval of days, weeks, months, months last day or
years.
* Start date and next invoice date.
* Invoicing type: pre-paid or post-paid.

#. Add the lines to be invoiced with the product, description, quantity and
price.
#. You can mark Auto-price? for having a price automatically obtained applying
the pricelist to the product price.
#. You have the possibility to use the markers #START# or #END# in the
description field to show the start and end date of the invoiced period.
#. Choosing between pre-paid and post-paid, you modify the dates that are shown
with the markers.
#. A cron is created with daily interval, but if you are in debug mode, you can
click on *Create invoices* to force this action.
#. Click *Show recurring invoices* link to show all invoices created by the
contract.
#. Click on *Print > Contract* menu to print contract report.
#. Click on *Send by Email* button to send contract by email.

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

* Recover states and others functional fields in Contracts.


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:%2011.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
~~~~~~~

* OpenERP SA
* Tecnativa
* LasLabs

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

* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Carlos Dauden <carlos.dauden@tecnativa.com>
* Angel Moya <angel.moya@domatix.com>
* Dave Lasley <dave@laslabs.com>
* Vicent Cubells <vicent.cubells@tecnativa.com>
* Miquel Raïch <miquel.raich@eficent.com>

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/11.0/contract>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions contract/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
33 changes: 33 additions & 0 deletions contract/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': 'Contracts Management - Recurring',
'version': '12.0.1.0.0',
'category': 'Contract Management',
'license': 'AGPL-3',
'author': "OpenERP SA, "
"Tecnativa, "
"LasLabs, "
"Odoo Community Association (OCA)",
'website': 'https://github.com/oca/contract',
'depends': ['base', 'account', 'analytic'],
'data': [
'security/ir.model.access.csv',
'security/contract_security.xml',
'report/report_contract.xml',
'report/contract_views.xml',
'data/contract_cron.xml',
'data/mail_template.xml',
'views/account_analytic_account_view.xml',
'views/account_analytic_contract_view.xml',
'views/account_invoice_view.xml',
'views/res_partner_view.xml',
],
'installable': True,
}
16 changes: 16 additions & 0 deletions contract/data/contract_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding='UTF-8'?>
<odoo noupdate="1">

<record model="ir.cron" id="account_analytic_cron_for_invoice">
<field name="name">Generate Recurring Invoices from Contracts</field>
<field name="model_id" ref="analytic.model_account_analytic_account"/>
<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>
64 changes: 64 additions & 0 deletions contract/data/mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" ?>
<odoo noupdate="1">

<record id="email_contract_template" model="mail.template">
<field name="name">Email Contract Template</field>
<field name="email_from">${(object.user_id.email and '%s &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
<field name="subject">${object.company_id.name} Contract (Ref ${object.name or 'n/a'})</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="model_id" ref="contract.model_account_analytic_account"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="contract.report_contract"/>
<field name="report_name">Contract</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
<p>Hello ${object.partner_id.name or ''},</p>
<p>A new contract has been created: </p>

<p style="border-left: 1px solid #8e0000; margin-left: 30px;">
&nbsp;&nbsp;<strong>REFERENCES</strong><br />
&nbsp;&nbsp;Contract: <strong>${object.name}</strong><br />
% if object.date_start:
&nbsp;&nbsp;Contract Date Start: ${object.date_start or ''}<br />
% endif

% if object.user_id:
% if object.user_id.email:
&nbsp;&nbsp;Your Contact: <a href="mailto:${object.user_id.email or ''}?subject=Contract%20${object.name}">${object.user_id.name}</a>
% else:
&nbsp;&nbsp;Your Contact: ${object.user_id.name}
% endif
% endif
</p>

<br/>
<p>If you have any questions, do not hesitate to contact us.</p>
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p>
<br/>
<br/>
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;">
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
</div>
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
<span style="color: #222; margin-bottom: 5px; display: block; ">
${object.company_id.partner_id.sudo().with_context(show_address=True, html_format=True).name_get()[0][1] | safe}
</span>
% if object.company_id.phone:
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
Phone: ${object.company_id.phone}
</div>
% endif
% if object.company_id.website:
<div>
Web: <a href="${object.company_id.website}">${object.company_id.website}</a>
</div>
%endif
<p></p>
</div>
</div>
]]></field>
</record>

</odoo>
Loading