Comments (28)
@m3dbedb similar issue here as well. @lasley
- Install Contract
- Go to Invoicing, Contracts, Contract Templates.
- Add an invoice line
- Select [CARD] Graphics Card
- Following Error appears:
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 862, in call_kw
return self._call_kw(model, method, args, kwargs)
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/odoo/models.py", line 5460, in onchange
record._onchange_eval(name, field_onchange[name], result)
File "/opt/odoo/odoo/models.py", line 5358, in _onchange_eval
method_res = method(self)
File "/media/sf_odoo10dev/contract/contract/models/account_analytic_invoice_line.py", line 85, in _onchange_product_id
vals['price_unit'] = product.price
File "/opt/odoo/odoo/fields.py", line 868, in __get__
self.determine_value(record)
File "/opt/odoo/odoo/fields.py", line 979, in determine_value
self.compute_value(recs)
File "/opt/odoo/odoo/fields.py", line 934, in compute_value
self._compute_value(records)
File "/opt/odoo/odoo/fields.py", line 926, in _compute_value
getattr(records, self.compute)()
File "/opt/odoo/addons/product/models/product.py", line 187, in _compute_product_price
prices = pricelist.get_products_price(self, quantities, partners)
File "/opt/odoo/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 "/opt/odoo/addons/product/models/product_pricelist.py", line 154, in _compute_price_rule
(prod_tmpl_ids, prod_ids, categ_ids, self.id, date, date))
File "/opt/odoo/odoo/sql_db.py", line 141, in wrapper
return f(self, *args, **kwargs)
File "/opt/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.
from contract.
Is this fixed?
from contract.
I'd imagine so. Mine ended up being unrelated and I've added invoice lines since then and it seems fine.
from contract.
#92 should do the trick. Amended the commit to include this ticket
from contract.
I've just tried a locally patched version with all those 5 commit (#92) Unfortunately it doesn't fix the issue.
Just to add more info, this is the error log from runbot:
File "/.repo_requirements/odoo/odoo/http.py", line 640, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/.repo_requirements/odoo/odoo/http.py", line 677, in dispatch
result = self._call_function(**self.params)
File "/.repo_requirements/odoo/odoo/http.py", line 333, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/.repo_requirements/odoo/odoo/service/model.py", line 101, in wrapper
return f(dbname, *args, **kwargs)
File "/.repo_requirements/odoo/odoo/http.py", line 326, in checked_call
result = self.endpoint(*a, **kw)
File "/.repo_requirements/odoo/odoo/http.py", line 935, in __call__
return self.method(*args, **kw)
File "/.repo_requirements/odoo/odoo/http.py", line 506, 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 687, in call_kw
return call_kw_model(method, model, args, kwargs)
File "/.repo_requirements/odoo/odoo/api.py", line 672, in call_kw_model
result = method(recs, *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 "/home/odoo/odoo-10.0/addons/account/models/account_invoice.py", line 345, in create
invoice = super(AccountInvoice, self.with_context(mail_create_nolog=True)).create(vals)
File "/home/odoo/odoo-10.0/addons/mail/models/mail_thread.py", line 228, in create
thread = super(MailThread, self).create(values)
File "/.repo_requirements/odoo/odoo/models.py", line 3806, in create
vals = self._add_missing_default_values(vals)
File "/.repo_requirements/odoo/odoo/models.py", line 1639, in _add_missing_default_values
defaults = self.default_get(list(missing_defaults))
File "/.repo_requirements/odoo/odoo/models.py", line 1131, in default_get
defaults = self._convert_to_write(defaults)
File "/.repo_requirements/odoo/odoo/models.py", line 4931, in _convert_to_write
value = field.convert_to_cache(value, self, validate=False)
File "/.repo_requirements/odoo/odoo/fields.py", line 2013, in convert_to_cache
raise ValueError("Wrong value for %s: %s" % (self, value))
ValueError: Wrong value for account.invoice.analytic_account_ids: 12```
from contract.
And this is from a locally patched module:
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 640, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 677, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 333, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/service/model.py", line 101, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 326, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 935, in __call__
return self.method(*args, **kw)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 506, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 885, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 877, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 687, in call_kw
return call_kw_model(method, model, args, kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 672, in call_kw_model
result = method(recs, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_invoice.py", line 345, in create
invoice = super(AccountInvoice, self.with_context(mail_create_nolog=True)).create(vals)
File "/usr/lib/python2.7/dist-packages/odoo/addons/mail/models/mail_thread.py", line 228, in create
thread = super(MailThread, self).create(values)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3806, in create
vals = self._add_missing_default_values(vals)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 1639, in _add_missing_default_values
defaults = self.default_get(list(missing_defaults))
File "/usr/lib/python2.7/dist-packages/odoo/addons/utm/models/utm.py", line 61, in default_get
values = super(UtmMixin, self).default_get(fields)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 1131, in default_get
defaults = self._convert_to_write(defaults)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 4931, in _convert_to_write
value = field.convert_to_cache(value, self, validate=False)
File "/usr/lib/python2.7/dist-packages/odoo/fields.py", line 2013, in convert_to_cache
raise ValueError("Wrong value for %s: %s" % (self, value))
ValueError: Wrong value for account.invoice.analytic_account_ids: 9
from contract.
@primes2h - You tested the Runbot that was built on #92? It was expired long ago and didn't have logs available, so I think you were not on it.
I rebuilt and retested - invoices are generating fine. Can you please test using the Runbot that is currently available in the #92 PR and let me know replication steps if it does not work?
from contract.
@lasley The previous log from runbot was just to add some info about the bug itself.
Only the second log reported was from a patched module.
Anyway I've just tested the new runbot based on #92 PR and the bug is still there.
Steps to reproduce:
- Click on Invoicing, Sales→Contracts
- Open the existing Contract
- Click on "Invoices" button in the upper-right side
- Create a new invoice
- Fill in data in the the new invoice
- Save
from contract.
@primes2h - I don't think that is a supported method of creating the invoices, because they won't contain the proper contract information. Keep in mind that this module is for automatic invoice creation, not manual.
We do have a way to create the invoices for testing though (or one-off invoice creations), which will use the same processes that the cron does. You'll need to enable developer mode, then a Create Invoices
link appears:
from contract.
You are talking about recurring invoice, and I know that works in that way "if" you select "Generate recurring invoices automatically".
But it's a choice, you could need some contracts with recurring invoices (using the checkbox) and some without (leaving it blank), and add some contract invoice manually.
If you try to add another contract (with no recurring invoice) the error come up as well.
So it's definitely a bug.
If the module is intended to be for automatic invoice creation, you should remove "Generate recurring invoice" checkbox in my opinion.
from contract.
@primes2h - The "Invoices" button is provided by the contract_show_invoice
module, but creation is not within the scope in that ReadMe. Contracts are typically naive of the invoices that they create - the contract_show_invoice
is honestly just kind of a hack to get you to see the invoices (it's just a search on the pre-existing invoice view filtered for the proper analytic account ID).
It sounds like you're going a bit outside of the admittedly tiny box that these modules cover. Would you mind elaborating a bit more on your use case? It sounds like you may be interested in the work being done to expand the scope of this repo
from contract.
If the module is intended to be for automatic recurring invoice creation (and not manual), you should remove "Generate recurring invoice" checkbox in my opinion.
from contract.
@primes2h - The issue is that contracts are analytic accounts. You are looking at an analytic account view when you're looking at the contracts, so the checkbox is required to add the automation logic to those analytic accounts. This is what the mailing list thread I referenced is about - the current design is not really that good, but it's what we have right now.
We could maybe default the checkbox to True
when in the contracts view though. Do you think that would help? Or maybe something else?
from contract.
It's also worth noting that invoices can be created and assigned to contracts, because they are analytic accounts.
You'll need to enable analytic accounting though I think, because it would be on the line items of the invoices and not the invoices themselves. @pedrobaeza correct me if I'm wrong here
from contract.
It "worths" in my opinion because invoices could belong to a contract and so be grouped together.
If you need to know what invoices come from that Contract, you can open the contract itself and click on the Invoices button on the upper-right side (in fact this is the purpose of that button, isn't it?)
Going back to this kind of bug, what I would like to explain is that, generally speaking, a module should be self-consistent.
If a traceback come up on the screen just after clicking the save button, I think it's definitely a bug, regardless the way you reach that point.
from contract.
This problem is caused by the module contract_show_invoice
with missing brackets and attempt assign default value to compute fieldcontract/contract_show_invoice/models/invoice.py
Lines 12 to 24 in c9b1e49
BTW I think this module should not be in this repository because the module links analytic info, the contract field is
from contract.
You can reproduce the bug without that module (contract_show_invoice) installed.
Anyway I tried to install it but the bug is still there, nothing changed.
Anyway, I'll try to do some debug later, I hope to find something useful to fix this bug.
from contract.
@primes2h - The Invoices
button is introduced in contract_show_invoice
. How are you reproducing the error without the Invoices
button?
There is a "Show recurring invoices" link, but I was able to create an invoice using that one just fine & it linked properly.
from contract.
Wait why the hell does a module exist to add a button for invoices, when we already have a link for invoices...
from contract.
For the invoices that have that analytic account, but not coming from recurring invoicing.
from contract.
The Show recurring invoices
link does that as well. I created an invoice after clicking that link, then went back and it was there (it's the Edward Foster one without a source document)
from contract.
Don't go through the button, but add an invoice through Accounting and select that analytic account in an invoice line.
from contract.
Ohhhhhh interesting - it looks like contract_show_invoices
has more bugs then, because it does not show the invoice I created (through Customer Invoices) either.
I did notice something though - if you create an invoice after clicking the link - it's a vendor invoice.
Creating a vendor invoice will show it in the Invoices
link, but not the Show recurring invoices
link as intended.
from contract.
from contract.
Sorry, https://github.com/OCA/contract/pull/84/files#diff-508bda2f042a03d3c3f947df8fa38c0c
from contract.
@carlosdauden you were absolutely right! The problem was the missing brackets. I didn't realize that I was working on another local odoo installation on which the contract_show_invoice was installed
from contract.
#99 does the trick to fix this bug
from contract.
@lasley
yes, I confirm those bugs.
About the last one you reported, invoices are not linked with the contract itself (Source Document field is empty).
from contract.
Related Issues (20)
- Issue with auto pricing on contract template lines HOT 1
- Migration to version 17.0 HOT 5
- Error when selected auto renew in contract template HOT 2
- 12.0 > contract_forecast : Do not display any forecast HOT 1
- [12.0] You can't have a date of next invoice anterior to the start of the contract line XX on pre-paid contract HOT 7
- [contract] Stability between versions HOT 2
- Error when stopping lines in the contract HOT 1
- [14.0][15.0] Incorrect selection of Payment Mode from the Partner data HOT 6
- Error from generate Sale activitie planification contract HOT 1
- [13.0][MIG] The contract/migrations/13.0.2.10.0 folder must be deleted in order to complete the migration from 12 to 13 if errors HOT 1
- Keyerror when creation recurring invoice (manually or via cron) HOT 4
- [15.0] You can't have the end date before the date of last invoice for the contract line HOT 2
- Remaining fields to compute before setting up registry HOT 2
- product_contract: quantities and analytic tags are not taken into generated contracts HOT 1
- Q: How to use contract modules for managing subscriptions? HOT 3
- [14.0] contract price lists broken HOT 2
- [15.0] stop contract line causes error creating new invoice HOT 1
- The form to create manually the invoices, is too slow, almost half a minute for every invoice generation HOT 1
- Create contract not generating recurring_next_date HOT 1
- When creating invoice, the last_date_invoice is with wrong date for 2 or more products HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contract.