openerp

TypeError: create() got multiple values for keyword argument 'context'

爱⌒轻易说出口 提交于 2019-12-06 05:32:53
I got an error like this: TypeError: create () got multiple values ​​for keyword argument 'context' This is the code: mov_id = self.create(cr, uid, ids, {'so_ids':so, 'product_ids':product},context=context) What's the problem? To create a record, the parameters are cursor, user_id, dictionary of values and context. for example mov_id = self.create(cr, uid, {'so_ids': so, 'product_ids': product},context=context) create doesnt take any ids, if you are trying to use copy, then use mov_id = self.copy(cr, uid, ids, {'so_ids':so, 'product_ids':product},context=context) self.create(cr, uid, {'so_ids'

Compute method is called multiple times?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 03:52:17
I found out that this probably isn't concurrency problem as the method is recalled JUST WHEN I TRY TO UPDATE THE sync.test.subject.b 's separated_chars FIELD (at the end of the method). So I can't solve this with thread locking as the method actually waits for itself to be called again. I don't get it this is a totally bizarre behavior. I found a weird behavior while updating computed fields. In this case codes are better than words: Models: from openerp import models, fields, api, _ class sync_test_subject_a(models.Model): _name = "sync.test.subject.a" name = fields.Char('Name') sync_test

How to browse or search One2many field in Odoo?

倖福魔咒の 提交于 2019-12-06 03:51:07
问题 I've extended the 'account.analytic.account' model with a One2many field that references a second model with a One2many field. When I try to iterate through the second One2many field from the compute method it only lists records that have just been added. Previous records (which are visible on the interface) are not visible in code using the 'self' context until the parent record is saved. example: for line in self.One2manyField: #only gets here for records I add during current session, or

odoo - get value from many2one field

99封情书 提交于 2019-12-06 03:47:07
My code: class SaleOrder(osv.Model): _inherit = 'sale.order' _columns = { 'xx_delivery_date': fields.date(string='Delivery date'), 'xx_payment_method': fields.many2one('xx.payment.method', string='Payment method'), 'xx_insurance_type': fields.many2one('xx.insurance.type', string='Insurance') } def _amount_insurance(self, cr, uid, val1, context=None): val = 0.0 insurance_chosen = self.pool.get('xx.insurance.type').browse(cr, uid, insurance_percentage.id,context=context) val = val1*insurance_chosen/100 return val class InsuranceType(osv.Model): _name='xx.insurance.type' _columns = { 'name' :

Odoo 10 - Adding an Order Line Tree Field to Custom Module

江枫思渺然 提交于 2019-12-06 03:33:15
I would like to add an order line field with a tree view much like those found in the Sales and Repairs modules. In those modules, there is a nice section at the bottom of the form that allows you to enter products and prices in a list. I believe those are handled by the sale.order.line and mrp.repair.line models. Here is a picture of what I am talking about: Sale Order Lines My goal is to get something like this into my own custom module. I have tried: Adding a One2many field with sale.order.line ( sale_order_line = fields.One2many('sale.order.line', 'order_id', string='Order Lines',) ). With

How to add autoincremental field in OpenERP 7?

假如想象 提交于 2019-12-06 03:29:32
问题 I searched and modified the source code of a simple custom module of openerp, I give the code below init .py import sim openerp .py { 'name': 'Student Information Management', 'version': '0.1', 'category': 'Tools', 'description': """This module is for the Student Information Management.""", 'author': 'Mr Praveen Srinivasan', 'website': 'http://praveenlearner.wordpress.com/', 'depends': ['base'], 'data': ['sim_view.xml'], 'demo': [], 'installable': True, 'auto_install': False, 'application':

Is there anyone integratted ODOO with Android?

放肆的年华 提交于 2019-12-06 02:41:46
I am currently developing an android application for a client who is insisting to use Odoo for API.I don't have any single idea about it I am not getting it any even after referring this link .They provide a URL, Database name, username, and password.If any one did Odoo with Android before, Can you give any suggestions? There are a lot of ways to connect Android to Odoo. Here they are: Json-RPC XML-RPC (especially aXMLRPC , this is what I am using) There is also a framework called Odoo Mobile Framework . I have tried it but found a lot of issues and I was not able to get it work properly. You

Where OpenERP (Odoo) finds the modules path?

人盡茶涼 提交于 2019-12-05 23:56:40
问题 I am using Odoo v.8. I want to find out where Odoo finds information where the modules are, to load them. I am aware there is a variable addons_path in the file openerp-server.conf. The only file I have found the variable in is opt/odoo/odoo/debian/openerp-server.conf. It has the following value: addons_path = /usr/lib/python2.7/dist-packages/openerp/addons However, the Odoo application is using modules from "/opt/odoo/odoo/addons" path. Where the Odoo retrieves this information from? If I

OpenERP - redirected to “Create a New Database” page when accessing Odoo application

随声附和 提交于 2019-12-05 23:34:14
When I try to access my Odoo 8 application I am redirected to Database Management menu and page "Create a New Database". However, there is a database in the system, I can see it through pgAdmin fine, and it worked all the time until now. As far as I know I have not changed anything. How I can make Odoo 8 connecting to already present database again as it did before? Thanks for your help! You should also check the ownership of the database. If you restore it from psql, make sure you set the owner to your openerp user. ALTER DATABASE your_db OWNER TO your_openerp_user DB user & password are

How to migrate an Openerp v7 database to Odoo v8?

筅森魡賤 提交于 2019-12-05 19:53:38
I have a dump file of database backup(openerp-7). Now I want to continue my work in Odoo, the database is in openerp-7 format so I am not able to restore it in Odoo. How to convert this database to Odoo version in order to start working on it? You must do a data migration. That's not an easy task. You can use some of this migration tools: OpenUpgrade . Or you can use some ETL tool such as Odoo ETL If you only want migrate some table you can export it in a CSV file and import it in Odoo choosing the right columns. Using pgadmin3,we can export the tables and import in our desired database of