v 12.0 Third Party 751
Download for v 12.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Invoicing (account)
Discuss (mail)
Community Apps Dependencies
Lines of code 4594
Technical Name contract_sale_generation
LicenseAGPL-3
Websitehttps://github.com/OCA/contract
Versions 16.0 12.0 14.0 15.0
You bought this module and need support? Click here!

Contracts Management - Recurring Sales

Beta License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runboat

This module extends functionality of contracts to be able to generate sales orders instead of invoices.

Table of contents

Usage

To use this module, you need to:

  1. Go to Sales -> Contracts and select or create a new contract.
  2. Fill fields for selecting the recurrency and invoice parameters:
    • Type defines document that contract will generate, can be “Sales” or “Invoices”
    • Sale Autoconfirm, validate Sales Orders if type is “Sales”

Bug Tracker

Bugs are tracked on GitHub Issues. 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 feedback.

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

Credits

Authors

  • PESOL

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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 project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
There are no ratings yet!
Please Help in error
by
Jorge saavedra
on 2/1/23, 10:13 PM

Error:
Odoo Server Error

Traceback (most recent call last):
File "/odoo/odoo-server/odoo/ line 4741, in ensure_one
_id, = self._ids
ValueError: too many values to unpack (expected 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/odoo/odoo-server/odoo/tools/ line 350, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in
File "/odoo/custom/varios/contract_sale_generation/models/ line 144, in cron_recurring_create_sale
sales |= contracts_to_sale._recurring_create_sale(date_ref)
File "/odoo/custom/varios/contract_sale_generation/models/ line 127, in _recurring_create_sale
so_rec.action_confirm()
File "/odoo/odoo-server/addons/event_sale/models/ line 19, in action_confirm
res = super(SaleOrder, self).action_confirm()
File "/odoo/odoo-server/addons/sale_management/models/ line 116, in action_confirm
res = super(SaleOrder, self).action_confirm()
File "/odoo/odoo-server/addons/sale/models/ line 745, in action_confirm
self._action_confirm()
File "/odoo/odoo-server/addons/sale_timesheet/models/ line 55, in _action_confirm
 
File "/odoo/odoo-server/odoo/ line 1003, in __get__
record.ensure_one()
File "/odoo/odoo-server/odoo/ line 4744, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: sale.order(1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/odoo/odoo-server/odoo/ line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/odoo-server/odoo/ line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/odoo/odoo-server/odoo/tools/ line 87, in reraise
raise value
File "/odoo/odoo-server/odoo/ line 698, in dispatch
result = self._call_function(**self.params)
File "/odoo/odoo-server/odoo/ line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/odoo/odoo-server/odoo/service/ line 98, in wrapper
return f(dbname, *args, **kwargs)
File "/odoo/odoo-server/odoo/ line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/odoo/odoo-server/odoo/ line 941, in __call__
return self.method(*args, **kw)
File "/odoo/odoo-server/odoo/ line 519, in response_wrap
response = f(*args, **kw)
File "/odoo/odoo-server/addons/web/controllers/ line 966, in call_button
action = self._call_kw(model, method, args, {})
File "/odoo/odoo-server/addons/web/controllers/ line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/odoo/odoo-server/odoo/ line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/odoo/odoo-server/odoo/ line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/odoo/odoo-server/odoo/addons/base/models/ line 76, in method_direct_trigger
self.sudo(
File "/odoo/odoo-server/odoo/addons/base/models/ line 553, in run
res = func(action, eval_context=eval_context)
File "/odoo/odoo-server/addons/website/models/ line 57, in run_action_code_multi
res = super(ServerAction, self).run_action_code_multi(action, eval_context)
File "/odoo/odoo-server/odoo/addons/base/models/ line 444, in run_action_code_multi
safe_eval(action.sudo().code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to return 'action'
File "/odoo/odoo-server/odoo/tools/ 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 "/odoo/odoo-server/odoo/tools/ line 86, in reraise
raise value.with_traceback(tb)
File "/odoo/odoo-server/odoo/tools/ line 350, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in
File "/odoo/custom/varios/contract_sale_generation/models/ line 144, in cron_recurring_create_sale
sales |= contracts_to_sale._recurring_create_sale(date_ref)
File "/odoo/custom/varios/contract_sale_generation/models/ line 127, in _recurring_create_sale
so_rec.action_confirm()
File "/odoo/odoo-server/addons/event_sale/models/ line 19, in action_confirm
res = super(SaleOrder, self).action_confirm()
File "/odoo/odoo-server/addons/sale_management/models/ line 116, in action_confirm
res = super(SaleOrder, self).action_confirm()
File "/odoo/odoo-server/addons/sale/models/ line 745, in action_confirm
self._action_confirm()
File "/odoo/odoo-server/addons/sale_timesheet/models/ line 55, in _action_confirm
 
File "/odoo/odoo-server/odoo/ line 1003, in __get__
record.ensure_one()
File "/odoo/odoo-server/odoo/ line 4744, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: : "Expected singleton: sale.order(1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659)" while evaluating
'model.cron_recurring_create_sale()'models.py",
fields.py",
default_company_id=self.company_id.id,
sale_order.py",sale.py",sale_order.py",sale_order.py",contract.py",contract.py",safe_eval.py",pycompat.py",safe_eval.py",ir_actions.py",ir_actions.py",ir_actions.py",user=cron.user_id.id).ir_actions_server_id.run()ir_cron.py",api.py",api.py",main.py",main.py",http.py",http.py",http.py",model.py",http.py",http.py",pycompat.py",http.py",http.py",models.py",fields.py",default_company_id=self.company_id.id,sale_order.py",sale.py",sale_order.py",sale_order.py",contract.py",contract.py",safe_eval.py",models.py",