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

[9.0][ADD] contract_mandate: New module #75

Merged
merged 1 commit into from
Sep 11, 2017

Conversation

carlosdauden
Copy link
Contributor

@carlosdauden carlosdauden commented Jun 3, 2017

This module allows to set a mandate mode on contract for creating the invoices with this mandate.

@Tecnativa

@rafaelbn rafaelbn added this to the 9.0 milestone Jun 5, 2017
@pedrobaeza
Copy link
Member

Please rebase.

@pedrobaeza pedrobaeza mentioned this pull request Jun 8, 2017
9 tasks
@rafaelbn
Copy link
Member

rafaelbn commented Jun 9, 2017

Please @carlosdauden rebase

@carlosdauden
Copy link
Contributor Author

@pedrobaeza @rafaelbn rebased

Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in runbot 👍

@rafaelbn
Copy link
Member

rafaelbn commented Aug 1, 2017

Dear @OCA/project-service-maintainers , this module is necessary as:

  • Your customers could have more than 1 bank account
  • In the case of 2 o more bank accounts you should be able to set different mandates to different contract o even more, one mandate for contracts and another ones for invoices

Please review! 😄

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got this server error. Steps to reproduce:

  • Create a contract
  • Select a partner.
  • Create a mandate for that partner.
  • Click Generate recurring invoices automatically checkbox.
  • Add a product to invoice.
  • Click on invoice smart button
  • Create an invoice.
  • Select partner on contract (it doesn't get the context)
  • The mandate is properly selected
  • Save invoice and get this error:
Odoo Server Error
Traceback (most recent call last):
  File "/.repo_requirements/odoo/openerp/http.py", line 650, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/.repo_requirements/odoo/openerp/http.py", line 687, in dispatch
    result = self._call_function(**self.params)
  File "/.repo_requirements/odoo/openerp/http.py", line 323, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/.repo_requirements/odoo/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/.repo_requirements/odoo/openerp/http.py", line 316, in checked_call
    result = self.endpoint(*a, **kw)
  File "/.repo_requirements/odoo/openerp/http.py", line 966, in __call__
    return self.method(*args, **kw)
  File "/.repo_requirements/odoo/openerp/http.py", line 516, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/odoo-9.0/addons/web/controllers/main.py", line 895, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/odoo-9.0/addons/web/controllers/main.py", line 887, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/.repo_requirements/odoo/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/.repo_requirements/odoo/openerp/api.py", line 354, in old_api
    result = method(recs, *args, **kwargs)
  File "/home/odoo/dependencies/bank-payment/account_banking_mandate/models/account_invoice.py", line 48, in create
    return super(AccountInvoice, self).create(vals)
  File "/.repo_requirements/odoo/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/odoo/dependencies/bank-payment/account_payment_partner/models/account_invoice.py", line 62, in create
    return super(AccountInvoice, self).create(vals)
  File "/.repo_requirements/odoo/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/odoo/odoo-9.0/addons/account/models/account_invoice.py", line 344, in create
    invoice = super(AccountInvoice, self.with_context(mail_create_nolog=True)).create(vals)
  File "/.repo_requirements/odoo/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/odoo/odoo-9.0/addons/mail/models/mail_thread.py", line 235, in create
    thread = super(MailThread, self).create(values)
  File "/.repo_requirements/odoo/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/odoo/dependencies/connector/connector/producer.py", line 48, in create
    record_id = create_original(self, vals)
  File "/.repo_requirements/odoo/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/.repo_requirements/odoo/openerp/models.py", line 4154, in create
    vals = self._add_missing_default_values(vals)
  File "/.repo_requirements/odoo/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/.repo_requirements/odoo/openerp/api.py", line 490, in new_api
    result = method(self._model, cr, uid, *args, **old_kwargs)
  File "/.repo_requirements/odoo/openerp/models.py", line 1785, in _add_missing_default_values
    defaults = self.default_get(cr, uid, list(missing_defaults), context)
  File "/.repo_requirements/odoo/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/.repo_requirements/odoo/openerp/api.py", line 354, in old_api
    result = method(recs, *args, **kwargs)
  File "/.repo_requirements/odoo/openerp/models.py", line 1345, in default_get
    defaults = self._convert_to_cache(defaults, validate=False)
  File "/.repo_requirements/odoo/openerp/models.py", line 5507, in _convert_to_cache
    for name, value in values.iteritems()
  File "/.repo_requirements/odoo/openerp/models.py", line 5508, in <dictcomp>
    if name in fields
  File "/.repo_requirements/odoo/openerp/fields.py", line 1796, in convert_to_cache
    raise ValueError("Wrong value for %s: %s" % (self, value))
ValueError: Wrong value for account.invoice.analytic_account_ids: 19

@carlosdauden
Copy link
Contributor Author

@chienandalu This error is related with other module review fix #82 😃

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved since related bug is already fixed

@rafaelbn rafaelbn merged commit 5561fe8 into OCA:9.0 Sep 11, 2017
@rafaelbn rafaelbn deleted the 9.0-contract_mandate branch September 11, 2017 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants