Coder Social home page Coder Social logo

contract's Introduction

Runboat Pre-commit Status Build Status codecov Translation Status

contract

TODO: add repo description.

Available addons

addon version maintainers summary
contract 17.0.1.0.1 Recurring - Contracts Management
contract_sale 17.0.1.0.0 Contract from Sale

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


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.

contract's People

Contributors

aliciagaarzo avatar carlosdauden avatar crogos avatar fkantelberg avatar francesco-ooops avatar gregory-moka avatar ibuioli avatar ivorra78 avatar jaydeep32 avatar jcdrubay avatar joanmforgeflow avatar lasley avatar liweijie0812 avatar marylla avatar mvrodriguez avatar mymage avatar nelsonramirezs avatar oca-git-bot avatar ozono avatar pedrobaeza avatar pedrocasi avatar pere-aquarian avatar rousseldenis avatar sbejaoui avatar sbidoul avatar svalaeys avatar thomasbinsfeld avatar victoralmau avatar weblate avatar wpichler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contract's Issues

[10.0] Overriding field analytic_account_id in account.analytic.contract.line breaks link between account.analytic.invoice.line and account.analytic.account.

I have a module where I need to have partner_id as a reference field in account.analytic.invoice.line. This should not pose any problem, as account.analytic.invoice.line refers with account_analytic_id to account.analytic.account, which has partner id.

This is my code:

  1 # -*- coding: utf-8 -*-                                                        
  2 # Copyright 2014-2017 Therp BV <https://therp.nl>.                             
  3 # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).                
  4 from odoo import api, fields, models                                           
  5                                                                                
  6                                                                                
  7 class AccountAnalyticInvoiceLine(models.Model):                                
  8     _inherit = 'account.analytic.invoice.line'                                 
  9                                                                                
...                                                         
 23     partner_id = fields.Many2one(                                              
 24         comodel_name='res.partner',                                            
 25         related='analytic_account_id.partner_id',                              
 26         string='Partner') 

Unfortunately the code in contract/models/account_analytic_contract_line.py breaks the original analytic_account_id:

  1 # -*- coding: utf-8 -*-                                                        
  2 # Copyright 2017 LasLabs Inc.                                                  
  3 # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).                
  4                                                                                
  5 from odoo import fields, models                                                
  6                                                                                
  7                                                                                
  8 class AccountAnalyticContractLine(models.Model):                               
  9                                                                                
 10     _name = 'account.analytic.contract.line'                                   
 11     _description = 'Contract Lines'                                            
 12     _inherit = 'account.analytic.invoice.line'                                 
 13                                                                                
 14     analytic_account_id = fields.Many2one(                                     
 15         string='Contract',                                                     
 16         comodel_name='account.analytic.contract',                              
 17         required=True,                                                         
 18         ondelete='cascade',                                                    
 19     )

The result is this:

2017-11-23 10:41:23,674 13472 DEBUG odownbdem10 odoo.modules.loading: loading module publication (55/57)
2017-11-23 10:41:23,721 13472 ERROR odownbdem10 odoo.fields: Problem setting up related field partner_id for model account.analytic.contract.line
2017-11-23 10:41:23,721 13472 ERROR odownbdem10 odoo.modules.registry: Error setting up fields for model account.analytic.contract.line
2017-11-23 10:41:23,721 13472 ERROR odownbdem10 odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
  File "/home/openeyedev/var/projects/oe_woonbond_10/odoo/parts/odoo/odoo/modules/registry.py", line 82, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/openeyedev/var/projects/oe_woonbond_10/odoo/parts/odoo/odoo/modules/loading.py", line 344, in load_modules
    loaded_modules, update_module)
  File "/home/openeyedev/var/projects/oe_woonbond_10/odoo/parts/odoo/odoo/modules/loading.py", line 243, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/openeyedev/var/projects/oe_woonbond_10/odoo/parts/odoo/odoo/modules/loading.py", line 141, in load_module_graph
    registry.setup_models(cr, partial=True)
  File "/home/openeyedev/var/projects/oe_woonbond_10/odoo/parts/odoo/odoo/modules/registry.py", line 306, in setup_models
    model._setup_fields(partial)
  File "/home/openeyedev/var/projects/oe_woonbond_10/odoo/parts/odoo/odoo/models.py", line 2850, in _setup_fields
    field.setup_full(self)
  File "/home/openeyedev/var/projects/oe_woonbond_10/odoo/parts/odoo/odoo/fields.py", line 502, in setup_full
    self._setup_related_full(model)
  File "/home/openeyedev/var/projects/oe_woonbond_10/odoo/parts/odoo/odoo/fields.py", line 540, in _setup_related_full
    field = target._fields[name]
KeyError: 'partner_id'

[contract_payment_auto] Lack of robustness - missing commits after each payment (?)

Hi folks,

I recently faced an important issue (see #165) which rolled back the creation of a bunch of payment transactions in odoo, while their acquirer counterpart operations were sent to the bank. At next cron execution time, all these operations were then re-executed, resulting in a double bank payment.

The consequences would have been mitigated if a commit had been executed in the recurring task loop. Do you agree? Where in the code would you put that commit? In AccountAnalyticAccount.recurring_create_invoice in contract/models/account_analytic_account.py? Any advice before I give it a try and submit a pull request?

[RFC] contract_cancel: Cancel Contract With Lapsed Invoices

This will be a fairly simple module that will automatically cancel any contract that has an invoice in Past Due status, instead of creating a new invoice. It will provide this option at the contract and contract template level in order to allow for customization where needed.

It will hook into the pre-existing account.analytic.account.recurring_create_invoice, and will first evaluate whether there are any past due invoices related to the contract. If there are, the recurring_invoices option will be deselected thus cancelling the contract. The super will not be called in this instance.

Simple enough I think, although I'm not sure if I'm going about the whole cancelling of the contract correctly. I think deactivating it is not what we're going for either though?

Let me know if you know of a pre-existing module/strategy for this that I'm overlooking, or if I'm going about this incorrectly.

Prorated invoicing of contracts

Hi,

I am currently encountering the following use case that I can't (or don't know how to) solve with the current modules. Any ideas on how to deal with this use case or any opinion on the proposed new feature?

First, I would like to invoice my contracts on the last day of each month (recurring_interval set to 'Month(s) last day').
But, I would like to invoice my contract based on a pro rata percentage if the contract didn't start / end on the first/ respectively last day of a month. So I would like to calculate the amount I charge to my customer based on the amount of days the contract was effectively active during the month. With the current module, a full fee is for example charged to the customer at the end of February, even though the contract only started on the 24th of February. I would like to charge my customer for only 5 days (from the 24th to the 28th of February), not for a full month.

In our opinion, the following feature/module should be added:

  • Adding a 'prorated invoicing' checkbox on a contract template and on the contract lines.
  • This box can only be checked when the 'recurring interval field' is set to 'Month(s) last day'
  • The 'prorated invoicing' checkbox on the contract line is automatically filled with the information coming from the contract template, but can be modified manually by the user on each contract line.

If this checkbox is checked, Odoo will apply a special 'pro rata rule' to calculate the amount to add on the invoice for the first and the last month of the contract (only!). The other months of the contract are invoiced normally (full amount).

One of the two following options should be chosen to calculate the pro rata percentage (that should be multiplied with the full amount to calculate the amount that will be charged to the customer for its first month of contract):

  1. Amount of days the contract was active (during the first month) divided by the amount of days we have in the month. So if the contract starts on the 24th of February, the pro rata percentage when the bill will be generated (on the 28th of February) will be (5/28 = 17,86%). So only 17,86% of the total amount will be charged to the customer for February.
  2. Amount of days the contract was active (during the first month) divided by a fixed amount of days (independently of the amount of days we have in the month). I divided 365 by 12 to obtain a plausible amount (= 30,42). Hence, for my example, we would have (5/30,42=16,44 %), so 16,44% of the total amount will be charged to the customer for February. This second method is easier as it doesn't take the amount of days of the month into account.

For the last month of the contract, we could either apply one of these 2 rules (the same as the one we chose for the first month) to calculate the pro rata percentage or we could decide to take the residual amount that was not charged to the customer on the first month and charge this amount to the customer on the last month (only if contracts cannot be cancelled before a full amount of months has been reached).

Any ideas / opinion on this?

Thanks

[V11] contract invoicing user

Invoicing user can see contracts menu, see contracts list but getting access error to account.analytic.invoice.line.

A user needs "Full accounting features" to use contracts, so it's better invoicing users not to see the contracts menu.

Migration to version 9.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-9.0

Modules to migrate

  • contract_account_banking_mandate > contract_mandate - By @carlosdauden - #75
  • contract_discount - Integrated into contract in #26
  • contract_invoice_merge_by_partner - By @cubells - #57
  • contract_journal - Integrated into contract in #26
  • contract_payment_mode - By @cubells - #56
  • contract_recurring_invoicing_marker - Integrated into contract in #26
  • contract_recurring_plans - Renamed to contract_recurring_analytic_distribution - By @cubells - #63
  • contract_show_invoice - #27
  • contract_show_recurring_invoice - Integrated into contract in #26

Recurring Invoices - Create Invoices

I'm getting error in debug mode when clicking 'Create Invoices' from Contract Recurring Invoices.
My Setup :

  1. Ubuntu 16.04
  2. Odoo 10 Community

screen shot 2017-06-22 at 2 48 06 am

I can't seem to get the same error in runbot.
Any ideas?

Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 638, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/http.py", line 675, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/http.py", line 331, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/service/model.py", line 119, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/http.py", line 324, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/http.py", line 933, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo/http.py", line 504, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/addons/web/controllers/main.py", line 866, in call_button
action = self._call_kw(model, method, args, {})
File "/opt/odoo/addons/web/controllers/main.py", line 854, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 681, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 672, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/addons/contract/models/account_analytic_account.py", line 181, in recurring_create_invoice
contract.with_context(ctx)._create_invoice()
File "/opt/odoo/addons/contract/models/account_analytic_account.py", line 158, in _create_invoice
invoice_vals = self._prepare_invoice()
File "/opt/odoo/addons/contract_payment_mode/models/contract.py", line 21, in _prepare_invoice
invoice_vals = super(AccountAnalyticAccount, self)._prepare_invoice()
File "/opt/odoo/addons/contract/models/account_analytic_account.py", line 153, in _prepare_invoice
return invoice._convert_to_write(invoice._cache)
File "/opt/odoo/odoo/models.py", line 4898, in _convert_to_write
value = field.convert_to_cache(value, self, validate=False)
File "/opt/odoo/odoo/fields.py", line 1884, in convert_to_cache
return process((value[0],))
IndexError: tuple index out of range

Last day of month

How can generate invoice with always the last day of the month.

Actually, if the previous month was a 30 days-month, the next month will be regenerate on 30 of the month instead of 31 of the month.

Maybe I do miss somethings

[BUG] 10.0 contract_sale_generation: Mixing apples and oranges: account.invoice().union(sale.order(11,))

Running the command:
~/odoo-10.0/odoo-bin -d moy6 --db-filter=^moy6$ --stop-after-init --log-level info --log-handler openerp.tools.yaml_import:DEBUG --test-enable --init agreement_account,agreement_sale,contract,contract_payment_auto,contract_payment_mode,contract_sale,contract_sale_generation,contract_show_invoice,contract_variable_quantity,product_contract,website_portal_contract

Using the fix #116

2017-11-10 05:52:24,660 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: ERROR: test_contract (odoo.addons.contract_sale_generation.tests.test_
contract_sale.TestContractSale)
2017-11-10 05:52:24,662 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: Traceback (most recent call last):
2017-11-10 05:52:24,662 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: `   File "contract_sale_generation/tes
ts/test_contract_sale.py", line 66, in test_contract
2017-11-10 05:52:24,663 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: `     self.contract.recurring_create_invoice()
2017-11-10 05:52:24,663 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: `   File "contract/models/account_anal
ytic_account.py", line 231, in recurring_create_invoice
2017-11-10 05:52:24,663 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: `     invoices |= contract.with_context(ctx)._create_invoice()
2017-11-10 05:52:24,664 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: `   File "odoo-10.0/odoo/models.py", line 5128, in __or__
2017-11-10 05:52:24,664 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: `     return self.union(other)
2017-11-10 05:52:24,665 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: `   File "odoo-10.0/odoo/models.py", line 5137, in union
2017-11-10 05:52:24,665 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: `     raise TypeError("Mixing apples and oranges: %s.union(%s)" % (sel
f, arg))
2017-11-10 05:52:24,665 6397 ERROR openerp_test odoo.addons.contract_sale_generation.tests.test_contract_sale: TypeError: Mixing apples and oranges: account.invoice().union(sale.order(11,))

Build log https://travis-ci.org/OCA/contract/jobs/300014336#L1430

Problem installing the module in Odoo 11

Hi, I am new to Oddo and I get the following error when trying to install the module:

Traceback (most recent call last):
  File "/home/odoo/odoo11/odoo/odoo/tools/convert.py", line 741, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/home/odoo/odoo11/odoo/odoo/tools/convert.py", line 651, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/home/odoo/odoo11/odoo/odoo/addons/base/ir/ir_model.py", line 1467, in _update
    record = record.create(values)
  File "/home/odoo/odoo11/odoo/odoo/addons/base/ir/ir_cron.py", line 69, in create
    return super(ir_cron, self).create(values)
  File "/home/odoo/odoo11/odoo/odoo/models.py", line 3277, in create
    record = self.browse(self._create(old_vals))
  File "/home/odoo/odoo11/odoo/odoo/models.py", line 3334, in _create
    parent_id = self.env[parent_model].create(parent_vals).id
  File "/home/odoo/odoo11/odoo/odoo/addons/base/ir/ir_actions.py", line 46, in create
    res = super(IrActions, self).create(vals)
  File "/home/odoo/odoo11/odoo/odoo/models.py", line 3277, in create
    record = self.browse(self._create(old_vals))
  File "/home/odoo/odoo11/odoo/odoo/models.py", line 3370, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/home/odoo/odoo11/odoo/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/odoo11/odoo/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.IntegrityError: null value in column "model_id" violates not-null constraint
DETAIL:  Failing row contains (356, Generate Recurring Invoices from Contracts, ir.actions.server, null, null, action, 1, 2018-01-03 14:27:43.959774, 1, 2018-01-03 14:27:43.959774, ir_cron, object_write, 5, null, null, # Available variables:
#  - env: Odoo Environment on which the a..., null, null, null).


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/odoo/odoo11/odoo/odoo/http.py", line 646, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/odoo11/odoo/odoo/http.py", line 307, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/odoo/odoo11/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/odoo/odoo11/odoo/odoo/http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "/home/odoo/odoo11/odoo/odoo/http.py", line 339, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo/odoo11/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/odoo11/odoo/odoo/http.py", line 332, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/odoo/odoo11/odoo/odoo/http.py", line 927, in __call__
    return self.method(*args, **kw)
  File "/home/odoo/odoo11/odoo/odoo/http.py", line 512, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/odoo11/odoo/addons/web/controllers/main.py", line 928, in call_button
    action = self._call_kw(model, method, args, {})
  File "/home/odoo/odoo11/odoo/addons/web/controllers/main.py", line 916, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo/odoo11/odoo/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/home/odoo/odoo11/odoo/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-39>", line 2, in button_immediate_install
  File "/home/odoo/odoo11/odoo/odoo/addons/base/module/module.py", line 71, in check_and_log
    return method(self, *args, **kwargs)
  File "/home/odoo/odoo11/odoo/odoo/addons/base/module/module.py", line 446, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/home/odoo/odoo11/odoo/odoo/addons/base/module/module.py", line 539, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/home/odoo/odoo11/odoo/odoo/modules/registry.py", line 84, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/odoo/odoo11/odoo/odoo/modules/loading.py", line 343, in load_modules
    loaded_modules, update_module)
  File "/home/odoo/odoo11/odoo/odoo/modules/loading.py", line 242, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/odoo/odoo11/odoo/odoo/modules/loading.py", line 156, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "/home/odoo/odoo11/odoo/odoo/modules/loading.py", line 94, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/home/odoo/odoo11/odoo/odoo/tools/convert.py", line 788, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/home/odoo/odoo11/odoo/odoo/tools/convert.py", line 849, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/home/odoo/odoo11/odoo/odoo/tools/convert.py", line 748, in parse
    exc_info[2]
  File "/home/odoo/odoo11/odoo/odoo/tools/pycompat.py", line 86, in reraise
    raise value.with_traceback(tb)
  File "/home/odoo/odoo11/odoo/odoo/tools/convert.py", line 741, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/home/odoo/odoo11/odoo/odoo/tools/convert.py", line 651, in _tag_record
    id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/home/odoo/odoo11/odoo/odoo/addons/base/ir/ir_model.py", line 1467, in _update
    record = record.create(values)
  File "/home/odoo/odoo11/odoo/odoo/addons/base/ir/ir_cron.py", line 69, in create
    return super(ir_cron, self).create(values)
  File "/home/odoo/odoo11/odoo/odoo/models.py", line 3277, in create
    record = self.browse(self._create(old_vals))
  File "/home/odoo/odoo11/odoo/odoo/models.py", line 3334, in _create
    parent_id = self.env[parent_model].create(parent_vals).id
  File "/home/odoo/odoo11/odoo/odoo/addons/base/ir/ir_actions.py", line 46, in create
    res = super(IrActions, self).create(vals)
  File "/home/odoo/odoo11/odoo/odoo/models.py", line 3277, in create
    record = self.browse(self._create(old_vals))
  File "/home/odoo/odoo11/odoo/odoo/models.py", line 3370, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/home/odoo/odoo11/odoo/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/odoo11/odoo/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
odoo.tools.convert.ParseError: "null value in column "model_id" violates not-null constraint
DETAIL:  Failing row contains (356, Generate Recurring Invoices from Contracts, ir.actions.server, null, null, action, 1, 2018-01-03 14:27:43.959774, 1, 2018-01-03 14:27:43.959774, ir_cron, object_write, 5, null, null, # Available variables:
#  - env: Odoo Environment on which the a..., null, null, null).
" while parsing /home/odoo/odoo11/odoo/addons/contract/data/contract_cron.xml:4, near
<record model="ir.cron" id="account_analytic_cron_for_invoice">
        <field name="name">Generate Recurring Invoices from Contracts</field>
        <field name="interval_number">1</field>
        <field name="interval_type">days</field>
        <field name="numbercall">-1</field>
        <field name="model" eval="'account.analytic.account'"/>
        <field name="function" eval="'cron_recurring_create_invoice'"/>
        <field name="args" eval="'()'"/>
    </record>
  

Contract template is useless because it creates empty invoices

I have tried to use contract templates in my own instalation of odoo 10 and in oca runbot and that is what happens:

  • I create a contract template with a product

  • I use this contract template in a contract

  • the resulting invoice is empty with no product

You can add the product directly to the contract and it works, but if you use the template , then the invoice is empty.

Limited by time contracts

In Odoo 8.0, you can select a defined amount of time on the contract, limiting the hours you can work on the project associated with the contract. Also, there's a computed field that shows the remaining time you have left.

Here's a screenshot of what I'm talking about:
renewal_contract

I haven't seen a way to do that with the OCA module, is it possible or it's pending to be done? I could try to work on it if no one's doing it.

[RFC] Contract Sales

On maintenance contract it's usual to have this cases:

  • periodicicaly invoices (done with contract module)
  • periodicicaly tasks, and task can consume materials, and invoice can depends on task and materials

If contract generate sales, we can define diferent products for tasks and materials, and create task for project, and stock picking for materials, this way sale order could be like "work order".

Other thing that I need is to have is recurring interval by product, not global.

I just start to work on a module called contract_sale to do this things.

[RFC] contract_auto: Automatic Payment

This module will provide the ability to accept automatic payments on contracts. It is a continuation of the discussion here.

I was originally trying to abstract this to work directly on invoices, but I cannot think of a good way to do that while still maintaining a streamlined workflow. As such, this RFC is limited in scope to contracts only (unless someone has a brilliant idea).

It will add a m2o on account.analytic.account to relate to a payment.token that should be used for automatic payment. The payment.token will be domain restricted to children of the partner_id of the account.analytic.account.

If a payment.token is defined on the account.analytic.account, the invoice will be validated immediately after creation. A payment will then be generated using the v10 server2server interface against the payment.token that is defined.

It will also add an m2o on account.analytic.account to relate to a mail.template. If a template is defined, it will be emailed to the customer automatically when the invoice is validated.

It will also add an option at the contract and contract template level to require the use of automatic payment on the contract. If this option is selected, a payment.token will be required for the contract.

Sounds simple enough I think. Anyone have any ideas of how to abstract this beyond contracts, or some existing code I can base on?

[v10] Contracts Management - Recurring: wrong value for account ID

After installation of "Contracts Management - Recurring" module, I create contract for demo customer agrolait, and when I try to create and save invoice for the contract, odoo say
" File "C:\Program Files (x86)\Odoo 10.0\server\odoo\fields.py", line 2011, in convert_to_cache
ValueError: Wrong value for account.invoice.analytic_account_ids: 7"
Same error found in runbot of odoo community.
contr

Error al Instalar el modulo contract_sale 11.0

tengo el sigueinte error al intentar instalar el modulo contract_sale en odoo 11.

Error:
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo/odoo11/odoo/tools/cache.py", line 84, in lookup
r = d[key]
File "/opt/odoo/odoo11/odoo/tools/func.py", line 68, in wrapper
return func(self, *args, **kwargs)
File "/opt/odoo/odoo11/odoo/tools/lru.py", line 44, in getitem
a = self.d[obj].me
KeyError: ('ir.model.data', <function IrModelData.xmlid_lookup at 0x7f4129ae27b8>,
'contract.action_account_analytic_sale_overdue_all')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 744, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 465, in _tag_menuitem
action_type, action_id = self.model_id_get(a_action)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 733, in model_id_get
return self.env['ir.model.data'].xmlid_to_res_model_res_id(id_str,
raise_if_not_found=raise_if_not_found)
File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1334, in xmlid_to_res_model_res_id
return self.xmlid_lookup(xmlid)[1:3]
File "", line 2, in xmlid_lookup
File "/opt/odoo/odoo11/odoo/tools/cache.py", line 89, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1323, in xmlid_lookup
raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: contract.action_account_analytic_sale_overdue_all

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo/odoo11/odoo/tools/safe_eval.py", line 350, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in
File "", line 2, in button_immediate_install
File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 71, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 449, in
button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 542, in
_button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo/odoo11/odoo/modules/registry.py", line 85, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/odoo11/odoo/modules/loading.py", line 380, in load_modules
loaded_modules, update_module, models_to_check)
File "/opt/odoo/odoo11/odoo/modules/loading.py", line 274, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/opt/odoo/odoo11/odoo/modules/loading.py", line 181, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/opt/odoo/odoo11/odoo/modules/loading.py", line 95, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 791, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 852, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 751, in parse
exc_info[2]
File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 744, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 465, in _tag_menuitem
action_type, action_id = self.model_id_get(a_action)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 733, in model_id_get
return self.env['ir.model.data'].xmlid_to_res_model_res_id(id_str,
raise_if_not_found=raise_if_not_found)
File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1334, in xmlid_to_res_model_res_id
return self.xmlid_lookup(xmlid)[1:3]
File "", line 2, in xmlid_lookup
File "/opt/odoo/odoo11/odoo/tools/cache.py", line 89, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1323, in xmlid_lookup
raise ValueError('External ID not found in the system: %s' % xmlid)
odoo.tools.convert.ParseError: "External ID not found in the system:
contract.action_account_analytic_sale_overdue_all" while parsing
/opt/odoo/odoo11/addons/contract_sale/views/account_analytic_account_view.xml:10, near

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo/odoo11/odoo/http.py", line 650, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo11/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/opt/odoo/odoo11/odoo/http.py", line 692, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo11/odoo/http.py", line 342, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo11/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo11/odoo/http.py", line 335, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo11/odoo/http.py", line 936, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo11/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo11/addons/web/controllers/main.py", line 1231, in run
result = request.env['ir.actions.server'].browse([action_id]).run()
File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_actions.py", line 554, in run
res = func(action, eval_context=eval_context)
File "/opt/odoo/odoo11/addons/website/models/ir_actions.py", line 57, in run_action_code_multi
res = super(ServerAction, self).run_action_code_multi(action, eval_context)
File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_actions.py", line 430, in run_action_code_multi
safe_eval(action.sudo().code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to
return 'action'
File "/opt/odoo/odoo11/odoo/tools/safe_eval.py", line 373, in safe_eval
pycompat.reraise(ValueError, ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e),
expr)), exc_info[2])
File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "/opt/odoo/odoo11/odoo/tools/safe_eval.py", line 350, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in
File "", line 2, in button_immediate_install
File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 71, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 449, in
button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo/odoo11/odoo/addons/base/module/module.py", line 542, in
_button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo/odoo11/odoo/modules/registry.py", line 85, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/odoo11/odoo/modules/loading.py", line 380, in load_modules
loaded_modules, update_module, models_to_check)
File "/opt/odoo/odoo11/odoo/modules/loading.py", line 274, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/opt/odoo/odoo11/odoo/modules/loading.py", line 181, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/opt/odoo/odoo11/odoo/modules/loading.py", line 95, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 791, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 852, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 751, in parse
exc_info[2]
File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 744, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 465, in _tag_menuitem
action_type, action_id = self.model_id_get(a_action)
File "/opt/odoo/odoo11/odoo/tools/convert.py", line 733, in model_id_get
return self.env['ir.model.data'].xmlid_to_res_model_res_id(id_str,
raise_if_not_found=raise_if_not_found)
File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1334, in xmlid_to_res_model_res_id
return self.xmlid_lookup(xmlid)[1:3]
File "", line 2, in xmlid_lookup
File "/opt/odoo/odoo11/odoo/tools/cache.py", line 89, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_model.py", line 1323, in xmlid_lookup
raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: <class 'odoo.tools.convert.ParseError'>: "External ID not found in the system:
contract.action_account_analytic_sale_overdue_all

/opt/odoo/odoo11/addons/contract_sale/views/account_analytic_account_view.xml 10" while evaluating 'records.button_immediate_install()'

Me podeis orientar por que estรก provocado el error?
Muchas gracias

Issue: Partner warning (block message) on invoice

On partner form you can set "Warning on invoices" as "Blocking message".

If this partner has contract with "Generate recurring invoices automatically" then the Scheduled Action "Generate Recurring Invoices from Contracts" will fails because is not able to create invoice without partner.

There is right to don't create this invoice, invoice could not be created, but all process fails and no one invoice is created from the other contracts.

I think we need to prevent set "Warning on invoices" as "Blocking message" is there are any contract on this partner, maybe with a constraint. And also show same warning mesage for invoices on contracts.

[Functional Improvement] Recurring Next Date Scoope

The cron function witch create recurring invoices is:

    @api.model
    def cron_recurring_create_invoice(self):
        today = fields.Date.today()
        contracts = self.with_context(cron=True).search([
            ('recurring_invoices', '=', True),
            ('recurring_next_date', '<=', today),
            '|',
            ('date_end', '=', False),
            ('date_end', '>=', today),
        ])
        return contracts.recurring_create_invoice()

That create invoices only if ('recurring_next_date', '<=', today)

what do you think about create invoices X days before, for example:

scoope_day = today + timedelta(X)
...
('recurring_next_date', '<=', scoope_day)

Partner delivery address in contracts

When creating invoices from contracts, the delivery address is not filled in the generated invoices. I am trying to modify this behaviour by adding the following code in contract/models/account_analytic_account.py without success:

214     @api.multi
215     def _prepare_invoice(self):
.....
239             'partner_shipping_id': self.partner_id.address_get(
240                 ['delivery'])['delivery'],

What should be modified in order for the invoice to catch the partner_id's partner_shipping_id?

Thanks in advance

[10.0] Scheduler 'Generate Recurring Invoices' doesn't work

When running the scheduler, this errror shows up:

2017-02-21 09:49:54,080 2663 ERROR openworx odoo.addons.base.ir.ir_cron: Call of self.env[u'account.analytic.account'].cron_recurring_create_invoice(*()) failed in Job 9
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_cron.py", line 119, in _callback
getattr(model, method_name)(*args)
File "/opt/odoo/addons/contract/models/contract.py", line 291, in cron_recurring_create_invoice
return contracts.recurring_create_invoice()
File "/opt/odoo/addons/contract/models/contract.py", line 280, in recurring_create_invoice
contract.with_context(ctx)._create_invoice()
File "/opt/odoo/addons/contract/models/contract.py", line 260, in _create_invoice
invoice_line_vals = self._prepare_invoice_line(line, invoice.id)
File "/opt/odoo/addons/contract/models/contract.py", line 209, in _prepare_invoice_line
self.env.context['next_date'], date_format)
File "/opt/odoo/addons/contract/models/contract.py", line 183, in _insert_markers
name = name.replace('#START#', date_from.strftime(date_format))
ValueError: year=1017 is before 1900; the datetime strftime() methods require year >= 1900

Recurring invoices currency is always Euro

This backport have a bug - I think it's a bug - that it creates all invoices with currency set to Euro.

I tried this with many DBs and same result.

If i create invoices normally out of contracts I get the correct currency.

So only invoices generated by this module gets a fixed currency of Euro.

Regards,

[11.0] error message by settings

On menupoint "settings" i get this error-message:

Fehler:
Odoo Server Error

Traceback (most recent call last):
  File "/usr/share/odoo/odoo/odoo/fields.py", line 937, in __get__
    value = record.env.cache.get(record, self)
  File "/usr/share/odoo/odoo/odoo/api.py", line 960, in get
    value = self._data[field][record.id][key]
KeyError: <odoo.api.Environment object at 0x7fbd1ee16d68>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/odoo/odoo/odoo/fields.py", line 937, in __get__
    value = record.env.cache.get(record, self)
  File "/usr/share/odoo/odoo/odoo/api.py", line 960, in get
    value = self._data[field][record.id][key]
KeyError: (<odoo.sql_db.Cursor object at 0x7fbd1ee16c50>, 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/odoo/odoo/odoo/fields.py", line 937, in __get__
    value = record.env.cache.get(record, self)
  File "/usr/share/odoo/odoo/odoo/api.py", line 960, in get
    value = self._data[field][record.id][key]
KeyError: (<odoo.sql_db.Cursor object at 0x7fbd1ee16c50>, 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/odoo/odoo/odoo/http.py", line 650, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/share/odoo/odoo/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/usr/share/odoo/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/usr/share/odoo/odoo/odoo/http.py", line 692, in dispatch
    result = self._call_function(**self.params)
  File "/usr/share/odoo/odoo/odoo/http.py", line 342, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/share/odoo/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/share/odoo/odoo/odoo/http.py", line 335, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/share/odoo/odoo/odoo/http.py", line 936, in __call__
    return self.method(*args, **kw)
  File "/usr/share/odoo/odoo/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/usr/share/odoo/odoo/addons/web/controllers/main.py", line 934, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/usr/share/odoo/odoo/addons/web/controllers/main.py", line 926, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/share/odoo/odoo/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/usr/share/odoo/odoo/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/usr/share/odoo/odoo/odoo/models.py", line 5127, in onchange
    for name in dirty
  File "/usr/share/odoo/odoo/odoo/models.py", line 5127, in <dictcomp>
    for name in dirty
  File "/usr/share/odoo/odoo/odoo/fields.py", line 2019, in convert_to_onchange
    return super(Many2one, self).convert_to_onchange(value, record, names)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 810, in convert_to_onchange
    return self.convert_to_read(value, record)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 2000, in convert_to_read
    return (value.id, value.sudo().display_name)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 941, in __get__
    self.determine_value(record)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 1052, in determine_value
    self.compute_value(recs)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 1008, in compute_value
    self._compute_value(records)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 999, in _compute_value
    getattr(records, self.compute)()
  File "/usr/share/odoo/odoo/odoo/models.py", line 1489, in _compute_display_name
    names = dict(self.name_get())
  File "/usr/share/odoo/odoo/odoo/models.py", line 1508, in name_get
    result.append((record.id, convert(record[name], record)))
  File "/usr/share/odoo/odoo/odoo/models.py", line 4758, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/usr/share/odoo/odoo/odoo/fields.py", line 941, in __get__
    self.determine_value(record)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 1052, in determine_value
    self.compute_value(recs)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 1008, in compute_value
    self._compute_value(records)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 1001, in _compute_value
    self.compute(records)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 589, in _compute_related
    record[self.name] = value[self.related_field.name]
  File "/usr/share/odoo/odoo/odoo/models.py", line 4758, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/usr/share/odoo/odoo/odoo/fields.py", line 941, in __get__
    self.determine_value(record)
  File "/usr/share/odoo/odoo/odoo/fields.py", line 1042, in determine_value
    record._prefetch_field(self)
  File "/usr/share/odoo/odoo/odoo/models.py", line 2646, in _prefetch_field
    result = records.read([f.name for f in fs], load='_classic_write')
  File "/usr/share/odoo/odoo/odoo/models.py", line 2590, in read
    self._read_from_database(stored, inherited)
  File "/usr/share/odoo/odoo/odoo/models.py", line 2709, in _read_from_database
    cr.execute(query_str, params)
  File "/usr/share/odoo/odoo/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/share/odoo/odoo/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.ProgrammingError: column account_analytic_account.contract_type does not exist
LINE 1: ..._analytic_account"."create_date" as "create_date","account_a...
                                                         ^

[BUG][10.0][product_contract] Product_contract: unable to confirm SO

Testing product_contract.
expecting to have a contract automatically created when added to a SO

problem: cannot validate SO

repoduce:
-Added a product with "is contract"
-created a SO and added the above product

  • a quotation is created (not a SO).
    -when clicking on button "confirm sale" I get a warning message:
    "
    Odoo Warning - Warning
    Please create some invoice lines.
    "

link to quotation:
http://3313915-10-0-2437d7.runbot2.odoo-community.org/web#id=15&view_type=form&model=sale.order&menu_id=183&action=257

[RFC] website_portal_contract: Website Contract Management

This module will provide website views for customer management of their existing contracts.

It will add a new field website_template_id to the account.analytic.contract model (and subsequently the account.analytic.account model). This field will act in the same way that the quote template works for website sales. A default template will be provided.

It will provide a new section in the website My Account, similar to the existing Your Quotes, Your Orders, etc & will be called Your Contracts.

In the Your Contracts listing, the following fields will be displayed in the table:

  • Display Name
  • Debit
  • Credit
  • Balance

Clicking a contract in the listing will take you to the website template associated with that contract.

Error installing module ย ยจcontract_payment_modeยจ

v11.0 - Error installing module
ย ยจcontract_payment_modeยจ


The operation can not be completed, probably due to the following factors:

  • deletion: you may be trying to delete a record while other records still refer to it
  • creation / update: a required field is not configured correctly

[object with reference: Payment methods - account.payment.mode]


Migration to version 12.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0

Modules to migrate

[10.0][BUG][contract] Error when adding a product in a invoice line when creating a contract template

2017-05-07_1-11-11


Traceback (most recent call last):
  File "/.repo_requirements/odoo/odoo/http.py", line 638, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/.repo_requirements/odoo/odoo/http.py", line 675, in dispatch
    result = self._call_function(**self.params)
  File "/.repo_requirements/odoo/odoo/http.py", line 331, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/service/model.py", line 119, in wrapper
    return f(dbname, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/http.py", line 324, in checked_call
    result = self.endpoint(*a, **kw)
  File "/.repo_requirements/odoo/odoo/http.py", line 933, in __call__
    return self.method(*args, **kw)
  File "/.repo_requirements/odoo/odoo/http.py", line 504, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/odoo-10.0/addons/web/controllers/main.py", line 885, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/odoo-10.0/addons/web/controllers/main.py", line 877, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/.repo_requirements/odoo/odoo/api.py", line 681, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/.repo_requirements/odoo/odoo/api.py", line 672, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/models.py", line 5494, in onchange
    record._onchange_eval(name, field_onchange[name], result)
  File "/.repo_requirements/odoo/odoo/models.py", line 5392, in _onchange_eval
    method_res = method(self)
  File "/home/odoo/build/OCA/contract/contract/models/account_analytic_invoice_line.py", line 85, in _onchange_product_id
    vals['price_unit'] = product.price
  File "/.repo_requirements/odoo/odoo/fields.py", line 870, in __get__
    self.determine_value(record)
  File "/.repo_requirements/odoo/odoo/fields.py", line 981, in determine_value
    self.compute_value(recs)
  File "/.repo_requirements/odoo/odoo/fields.py", line 936, in compute_value
    self._compute_value(records)
  File "/.repo_requirements/odoo/odoo/fields.py", line 927, in _compute_value
    getattr(records, self.compute)()
  File "/home/odoo/odoo-10.0/addons/product/models/product.py", line 190, in _compute_product_price
    prices = pricelist.get_products_price(self, quantities, partners)
  File "/home/odoo/odoo-10.0/addons/product/models/product_pricelist.py", line 254, in get_products_price
    return dict((product_id, res_tuple[0]) for product_id, res_tuple in self._compute_price_rule(zip(products, quantities, partners), date=date, uom_id=uom_id).iteritems())
  File "/home/odoo/odoo-10.0/addons/product/models/product_pricelist.py", line 154, in _compute_price_rule
    (prod_tmpl_ids, prod_ids, categ_ids, self.id, date, date))
  File "/.repo_requirements/odoo/odoo/sql_db.py", line 141, in wrapper
    return f(self, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/sql_db.py", line 218, in execute
    res = self._obj.execute(query, params)
ProgrammingError: operator does not exist: date <= boolean
LINE 1: ...1) AND (item.date_start IS NULL OR item.date_start<=false) A...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

cc @lasley @Tecnativa

[10.0] [contract_payment_auto] IntegrityError raised when token is related to the partner and not the contract

Traceback looks like:

xxxx:ERROR:odoo.addons.base.ir.ir_cron:Call of self.env[u'account.analytic.account'].cron_recurring_create_invoice(*()) failed in Job #6
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_cron.py", line 126, in _callback
    getattr(model, method_name)(*args)
  File "/opt/odoo_modules/contract/contract/models/account_analytic_account.py", line 304, in cron_recurring_create_invoice
    return contracts.recurring_create_invoice()
  File "/opt/odoo_modules/contract/contract/models/account_analytic_account.py", line 288, in recurring_create_invoice
    invoices |= contract.with_context(ctx)._create_invoice()
  File "/opt/odoo_modules/contract/contract_payment_auto/models/account_analytic_account.py", line 62, in _create_invoice
    self._do_auto_pay(invoice)
  File "/opt/odoo_modules/contract/contract_payment_auto/models/account_analytic_account.py", line 72, in _do_auto_pay
    self._pay_invoice(invoice)
  File "/opt/odoo_modules/contract/contract_payment_auto/models/account_analytic_account.py", line 94, in _pay_invoice
    self._get_tx_vals(invoice),
  File "/usr/lib/python2.7/dist-packages/odoo/addons/payment/models/payment_acquirer.py", line 497, in create
    tx = super(PaymentTransaction, self).create(values)
  File "/opt/odoo_modules/connector-telephony/base_phone/models/base.py", line 31, in create
    return super(Base, self).create(vals)
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3823, in create
    record = self.browse(self._create(old_vals))
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3918, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/usr/lib/python2.7/dist-packages/odoo/sql_db.py", line 154, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/sql_db.py", line 231, in execute
    res = self._obj.execute(query, params)
IntegrityError: null value in column "acquirer_id" violates not-null constraint
DETAIL:  Failing row contains (606, null, null, 2018-05-20 00:00:20.340395, FAC/18050428, 1, 1, null, null, null, 1, null, 29.00, draft, form, null, null, null, null, null, 2018-05-20 00:00:20.340395, null, null, null, null, null, null, null)

A pull request is coming soon. The bug is due to an inconsistency between the payment token existence tests in _pay_invoice and in _get_tx_vals.

[RFC] contract_company_users: Bill for companies & users

This module will provide the ability to create a contract that provides access into the current Odoo system. A user would purchase this contract for $X/user/$Interval, which would subsequently:

  • Create a company in Odoo related to the contract
  • Add the user to the new company
  • Give the user the ability manage permissions for their company
  • Provide different pricing for users dependent on their security permissions + a base price

The obvious challenge here is how to isolate the company selling the contract from the company purchasing it, while still allow the users to manage everything within their own company. My limited testing on this points me to believe that by assigning the master company as the parent of the new ones, things just seem to work.

To that end, following are my current specs. Would be interested to hear if anyone has thoughts on this plan - particularly if some other modules may assist me here somehow. The naming sucks too, so suggestions there would be awesome.

  1. It should provide the ability to relate products to user security groups
    1. It should hide a select set of groups that would be deemed harmful to the system (such as the ability to install applications, create server actions, etc)
  2. It should relate all users back to their contract, if there is one
  3. It should automatically determine invoice lines based on the amount of users matching the security group defined in the product related to the each contract line
  4. It should override the user creation view for any user that is related to a contract
    1. It should only allow for the selection of security groups named in the contract
    2. It should not allow any multi company options
  5. It should automatically create a proration invoice when a new user is created for a company
    1. It should automatically validate and bill against the contract's defined payment method
    2. It should add the correct product to the proration invoice by matching against the contract line product security group definitions
      1. If the new user does not match a contract line, an invoice should not be created
  6. It should allow for prices to be customized per subscription contract

[v10] Sales order creation not working

Hi, recently (this week) my contracts have stopped creating sales orders using both the automated actions and when I click "Create sales". I have set the server log level to debug and haven't seen anything obvious. See the following.


2018-04-20 02:41:00,409 14513 INFO LITTLEBUNYIP werkzeug: 192.168.1.4 - - [20/Apr/2018 02:41:00] "POST /longpolling/poll HTTP/1.1" 200 -
2018-04-20 02:41:11,325 14513 INFO LITTLEBUNYIP werkzeug: 127.0.0.1 - - [20/Apr/2018 02:41:11] "POST /longpolling/poll HTTP/1.1" 200 -
2018-04-20 02:41:24,052 14513 DEBUG LITTLEBUNYIP odoo.api: call account.analytic.account(23,).recurring_create_invoice()
2018-04-20 02:41:24,090 14513 INFO LITTLEBUNYIP werkzeug: 127.0.0.1 - - [20/Apr/2018 02:41:24] "POST /web/dataset/call_button HTTP/1.1" 200 -
2018-04-20 02:41:24,116 14513 DEBUG LITTLEBUNYIP odoo.api: call account.analytic.account().search_read([[u'id', u'in', [23]]], [u'message_follower_ids', u'project_count', u'code', u'date_end', u'recurring_invoicing_type', u'date_start', u'company_id', u'currency_id', u'recurring_invoices', u'crossovered_budget_line', u'partner_id', u'message_ids', u'journal_id', u'pricelist_id', u'create_invoice_visibility', u'type', u'sale_autoconfirm', u'active', u'recurring_next_date', u'name', u'recurring_interval', u'contract_template_id', u'tag_ids', u'use_tasks', u'recurring_rule_type', u'recurring_invoice_line_ids', u'display_name', u'__last_update'])
2018-04-20 02:41:24,155 14513 INFO LITTLEBUNYIP werkzeug: 127.0.0.1 - - [20/Apr/2018 02:41:24] "POST /web/menu/load_needaction HTTP/1.1" 200 -
2018-04-20 02:41:24,184 14513 INFO LITTLEBUNYIP werkzeug: 127.0.0.1 - - [20/Apr/2018 02:41:24] "POST /web/dataset/call_kw/account.analytic.account/search_read HTTP/1.1" 200 -
2018-04-20 02:41:24,228 14513 INFO LITTLEBUNYIP werkzeug: 127.0.0.1 - - [20/Apr/2018 02:41:24] "POST /mail/read_followers HTTP/1.1" 200 -
2018-04-20 02:41:24,262 14513 INFO LITTLEBUNYIP werkzeug: 127.0.0.1 - - [20/Apr/2018 02:41:24] "POST /web/dataset/search_read HTTP/1.1" 200 -
2018-04-20 02:41:24,319 14513 DEBUG LITTLEBUNYIP odoo.api: call account.analytic.invoice.line(49,).read([u'sequence', u'product_id', u'name', u'quantity', u'uom_id', u'automatic_price', u'price_unit', u'specific_price', u'discount', u'price_subtotal'])
2018-04-20 02:41:24,348 14513 INFO LITTLEBUNYIP werkzeug: 127.0.0.1 - - [20/Apr/2018 02:41:24] "POST /web/dataset/call_kw/account.analytic.invoice.line/read HTTP/1.1" 200 -

The "Date of next Invoice:" field advances to the correct next invoice date (1 week intervals) but an actual SO or even Quote is not created. Clicking the "Show recurring sales" link does not show any SO created either.

I am now running Odoo 10.0-20180413 (Community Edition) on Ubuntu 17.10 and subscribed to the nightly build repo for odoo 10 community edition (as per the odoo install instructions). There seems to be an update from this nightly build, well, every day. If I can provide more info let me know how to go about getting it for you guys.

[RFC] product_contract: Allow for the sales of contracts

This module will add a m2o relation on product.product (and maybe product.template) to account.analytic.contract provided in #42.

The purchasing of this related product will generate a contract based on the template, and begin invoicing.

Fairly simple, I'm actually not sure what else to describe here TBH. Just making sure there's no overlap or existing strategy I'm missing before we dev.

A better name for this may actually be sale_contract?

[RFC] website_sale_contract: Contract Signing

This module will inject a Contract Signing step in the e-commerce process, immediately before payment. The user will skip this stage if there is not a product in their cart set to is_contract, similar to how we do for prescriptions in medical. It will depend on product_contract and website_portal_contract.

In order to support contract signatures, a Binary field signature will be added to account.analytic.account along with a signatory char field to indicate who signed it.

During this stage, the first unsigned contract in the user's cart will be displayed (using the website_template_id provided in website_portal_contract). Below that, a freeform field will be provided to type the signatory name, as well as a jSignature for the actual signing.

Clicking Accept will continue either loop the above operation for the next unsigned contract in the cart, or proceed to payment.

The gotcha here is that the contract hasn't actually been created until after the sale is completed, which is after payment during e-commerce. This means that we will need to temporarily store the signature information, then assign it correctly during the action_done when the contract is actually created.

This module will also add the signer's information into the contract's detailed view in the website portal (provided in website_portal_contract), as well as show it in the backend for employees viewing the contract through the standard form view.

Anyone see something I'm missing, or a better way to go about this?

Migration to version 10.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-10.0

Modules to migrate

Agreement

We would like to publish a module to manage content for agreements and contracts. The module is meant to be used by the legal team of a company and to allow them to define sections, clauses and template with their respective content that can be dynamic. Based on the template, an agreement can be created and the pdf document generated. The agreement would go through a workflow to finally become a contract with the customer signature.

Let us know if this repository is not the right place.

[RFC] contract_auto_invoice_status: Invoice auto-validation on automatic payments

This module would be able to change the status of an invoice after automatically being paid using the contract_auto module.

The idea would be to have an option within on the payment_acquirer to be able to automatically modify the status of an invoice. Similar to the regular sales order flow with the option: "Authorize & capture the amount, confirm the SO and auto-validate the invoice on acquirer confirmation".

What I think it would be the outline of the steps are:

  • Fork LasLabs/contracts and create a branch from release/10.0/LABS-411-contract_auto
  • Modify payment.acquirer and add a field similar to auto_confirm to add the following options: No automatic status change, auto-validate the invoice on acquirer confirmation.
  • Create a new module named contract_auto_invoice_status that adds the logic to contracts_auto.
  • Open a PR with the dependence on PR #67.

I am an Odoo apprentice so guidance is very welcome. How does this sound?

[RFC] contract_affiliate: Create an affiliate program

This module will provide the ability to create an affiliate program based on contract.

It will add an affiliate_contract_id to account.analytic.contract & subsequent account.analytic.account. This affiliate contract will contain the details for payment to affiliate partner.

An Affiliate Contract will contain recurring invoice lines that are meant to be paid to the affiliate. contract_variable_quantity or similar logic could be used to add some sort of percentage scale based on the sold contract. It will also adhere to the start/end dates, which will allow for termination of affiliate payments after a certain point.

When an invoice is generated for a contract with an affiliate, an invoice will also be created to pay that affiliate. It will be created as a new invoice type affiliate_invoice, and will be displayed in an Affiliates section in Invoicing similar to Sales and Purchases. Affiliate contracts will also be filtered into this section, and not displayed in the standard Contracts area.

Affiliate invoices will be linked to their Contract invoice via the pre-existing refund_invoice_id relation.

When a Contract Invoice is paid, the Affiliate Invoice will need to move from Draft to Open. This will allow for payment holds until the Affiliate's customer has actually paid, and is necessary to circumvent exploit.

When a Contract Invoice is refunded, the Affiliate Invoice will need either be cancelled or reversed. This is also to circumvent exploit.

This RFC does not include scope for customer facing affiliate processes, such as Referral codes.

I'm wondering if there's any strategy already existing for something like this, or any other ideas that would help during the planning/dev.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.