This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.
in Odoo 8.0, I am trying to calculate the sum of payments made by a customer according to the customer's id. I wrote the following code but this hasn't helped at all. If any suggestions or help, you are more than welcome
def _get_sum_invoices(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x, 0), ids))
# The current user may not have access rights for sale orders
try:
for partner in self.browse(cr, uid, ids, context):
setOfInvoices = self.env['account.invoice'].search([('id', "in", partner.invoice_ids)])
total = 0
for invoice in setOfInvoices:
total += invoice.amount
res[partner.id] = total
except:
pass
return res
_columns = {
'sum_payments': fields.function(_get_sum_pay, string='# SUM', type='float'),
'total': fields.one2many('account.invoice', 'partner_id','Sum Of Payments')
}
How To add button in header in tree view when i add with button tag it applied in every field i need only one time in header section if idea anyone then plz say me
I would like to add Skype field to partner form to store Skype Name of our partners. I follow the instruction but I don't know what type of field to choose. Should it be char or text?
We have an implementation on sales.order that worked correctly until last week. Suddenly, some of the custom fields disappeared. If I check the FormView in debug, it shows the correct xml, but the UI is wrong.
Tests:
- Recovered a Monday backup, the UI is OK (lets call it "working" DB).
- Check modules: Although there where some differences, installing and/or removing them didn't change anything. Module Drop shipping was in the "fault" DB and not in the "working" and Sale_service module was in the "working" DB but not in the "fault" one. Once this differences were solved, the problem persists and the same modules are installed in both DB.
- A diff between FormViews confirmed that they are exactly the same. Even select arch from ir_ui_view where id = 566; returns the same content in both DBs.
- Checked all possible configuration issues (menu, views…) everything is the same.
There is a symptom which I can't relate to the problem. Although module Product & pricelist Module is installed. The menu Sales/Configuration/pricelist is not shown in the "faulty" database.
Changes prior to the error The only change done on the database was activating the Manage multiple locations and warehouses and Manage advanced routes for your warehouse options to create a Quotation from a Sale order. As far as I know no other changes were applied (there's another user with admin rights, but he claims that no change was done).
A solution could be restoring the backup, but that will only cover the issue that could raise at any moment if I don't find it's source. And users would loose their job from monday.
I was testing the flow of products from manufacturing to sales, later i noticed the items that are in done state in stock moves cant be deleted. whats the solution to this?
How to Set Default Debit Account and Default Credit Account for Opening Entries Journal in odoo 8 And I want to know "Opening Expense Account" Internal Type="Regular" and Account Type="Expense" and set Default Debit Account Account Code ? and Parent Account ?
"Opening Income Account" Internal Type="Regular" and Account Type="Income" and set Default Credit Account
I like to add some fields in the warehouse so I added the class with columns in the stock.py. But it shows error. I can not find what the error is.
The error message is
Traceback (most recent call last): File "/home/rck/Desktop/odoo-8.0/openerp/http.py", line 539, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/home/rck/Desktop/odoo-8.0/openerp/http.py", line 590, in dispatch return self._json_response(result) File "/home/rck/Desktop/odoo-8.0/openerp/http.py", line 528, in _json_response body = simplejson.dumps(response) File "/usr/local/lib/python2.7/dist-packages/simplejson/__init__.py", line 366, in dumps return _default_encoder.encode(obj) File "/usr/local/lib/python2.7/dist-packages/simplejson/encoder.py", line 269, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/local/lib/python2.7/dist-packages/simplejson/encoder.py", line 348, in iterencode return _iterencode(o, 0) File "/usr/local/lib/python2.7/dist-packages/simplejson/encoder.py", line 246, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: product.step1() is not JSON serializable
My py code in stock.py is
class product_step1(osv.osv): _name = "product.step1"