openerp

How to write a Python script that uses the OpenERP ORM to directly upload to Postgres Database

让人想犯罪 __ 提交于 2019-12-09 04:30:55
问题 I need to write a "standalone" script in Python to upload sales taxes to the account_tax table in the database using ONLY the ORM module of OpenERP. What I would like to do is something like the pseudo code below. Can someone provide me a more details on the following: 1) what sys.path's do I need to set 2) what modules do I need to import before importing the "account" module. Currently when I import the "account" module I get the following error: AssertionError: The report "report.custom"

Odoo MissingError One of the documents you are trying to access has been deleted, please try again after refreshing

雨燕双飞 提交于 2019-12-08 13:52:37
问题 Odoo Warning, MissingError One of the documents you are trying to access has been deleted, please try again after refreshing. Am accessing this button action_four_weeks_schedule_form which is shown below on . <field name='multiple_ratecard_id' nolabel="1" options="{'reload_on_button': true}"> <!-- widget="many2many"--> <tree string="ALLOCATE SPOTS" editable="bottom" > <button name="action_four_weeks_schedule_form" type="object" string="CREATE RATECARD SCHEDULE" class="oe_highlight" /> The

Odoo : Acces a column from many2one

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 13:14:31
Here is my problem : I'm in model1 : class model1(osv.osv): _name = 'model1' _columns = { 'name': fields.many2one('res.partner', u'Person', domain=[('my_boolean', '=', False)], required=True, select=True), 'type' = fields.selection([('1', 'One'), ('2', 'Two'), u'Select', required=True), } @api.onchange('type') def onchange_type_model1(self) self.name.model3_id = 2 And I want to modify in this onchange the value of the id of model3_id in res.partner: -res.partner in this module: class res_partner(osv.osv): _inherit = 'res.partner' _columns = { 'model1_partner_ids': fields.one2many('model1',

How to make a constraint on a fields

痞子三分冷 提交于 2019-12-08 12:46:41
问题 I want to put a control check on a field (TIN) so that everytime I create a new customer, the TIN should be unique. If another customer has that TIN, an error message must show up. I tried this syntax: _sql_constraints=[('uniq_vat', 'UNIQUE(self.env.vat)', 'It already exists another company with the same TIN!')] I'm using odoo 10. 回答1: Constrains can be of two types. Application Constraints Database Constraints Database Constraints Database constraints will add validation at database level

How can i generate xls report in odoo

ぐ巨炮叔叔 提交于 2019-12-08 12:15:35
问题 I want to generate my own excel report using Excel report engine in odoo 8. someone please send me a simple excel report sample or any helping URL. I'll be very thankful to you .... 回答1: Here is a simple piece of code. There is really a lot of examples on the internet with good explanations. I suggest you go through the code in detail to see how it works (by the way I have copied the code also from somewhere - I cannot remember where. Also have a look at the examples here:https://github.com

How to Install OpenERP plug-in for Eclipse IDE? [closed]

让人想犯罪 __ 提交于 2019-12-08 11:58:05
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I recently got informed that there is an OpenERP plugin for Eclipse IDE. Can anybody guide me on how to install it? I already have an OpenERP server installed. My OpenERP + PostgreSQL + Gedit (with OpenERP snippets) development environment is already set up. Now, I would just like to try eclipse to see if its

Python pdb debugger gets confused when Python method called after a tree_but_open event defined in XML

[亡魂溺海] 提交于 2019-12-08 11:24:16
问题 I am in the process of debugging something in OpenERP using Python 2.7.3. The debugger seems to get out of sync with the code when stepping through with the Next (n) command. When you type a debugger command such as print variable, it may give a different answer each time you do this. It also appears to skip backwards when stepping through the code. See Code and output below. I believe the problem may be related to the way OpenERP calls my method through a Python exec() statement by reading

Odoo 10 : Call a confirmation form (Yes / No) from Wizard

余生长醉 提交于 2019-12-08 10:54:21
问题 I want to add to my purchase order a 'cancel' button. This button will change the state of my record to 'canceled'. When the user click on this button the script verify all the purchase inquiries and provider orders if there is any one not done or canceled yet. I want to add a pop-up to warn the user about them. The user can cancel the operation or pursuit and cancel all the related inquiries and orders. This is my wizard model : # -*- coding: utf-8 -*- from odoo import models, fields, api

inherited function odoo python

不羁的心 提交于 2019-12-08 10:44:45
问题 i want to inherit function in module 'hr_holidays' that calculate remaining leaves the function is : hr_holiday.py: def _get_remaining_days(self, cr, uid, ids, name, args, context=None): cr.execute("""SELECT sum(h.number_of_days) as days, h.employee_id from hr_holidays h join hr_holidays_status s on (s.id=h.holiday_status_id) where h.state='validate' and s.limit=False and h.employee_id in %s group by h.employee_id""", (tuple(ids),)) res = cr.dictfetchall() remaining = {} for r in res:

Create custom field at delivery order (stock.picking.out) which gets its value from sales order

放肆的年华 提交于 2019-12-08 09:01:46
问题 I have a sales order form which contains a custom delivery date field. Now I want to pass the value from delivery date field in sales order to the commitment date field in delivery order (stock.picking.out). Did we make two columns in both stock.picking and stock.picking.out? And also how can I take the delivery date field value from sales order during the automatic creation of delivery order(at the click of confirm order button). I am using v7. Thanks in advance 回答1: I got the answer from