Menu
  • HOME
  • TAGS

Odoo , Domain, filter date and month

python,date,filter,odoo

I find the solution, sale.report is not a real model, it's a view. For add field, you need to overwrite select method. so class sale_report(osv.osv): _inherit = 'sale.report' date_order_month = fields.Char(string='Date Month') date_order_day = fields.Char(string='Date Day') def _select(self): select_str = """ SELECT min(l.id) as id, l.product_id as product_id, t.uom_id as...

What is Main difference between @api.onchange and @api.depends in Odoo(openerp)?

openerp,odoo,openerp-8

@api.depends This decorator is specifically used for "fields.function" in odoo. For a "field.function", you can calculate the value and store it in a field, where it may possible that the calculation depends on some other field(s) of same table or some other table, in that case you can use '@api.depends'...

Extend year range in odoo

openerp,odoo,odoo-8

Just follow this way I just try to do something like this from my end from openerp.osv import fields, osv from openerp import tools from dateutil.relativedelta import relativedelta import datetime class myclass_nextyear(osv.Model): _name='myclass.nextyear' def str_to_datetime(strdate): return datetime.datetime.strptime(strdate, tools.DEFAULT_SERVER_DATE_FORMAT) def compute_next_year_date(self, strdate): oneyear = datetime.timedelta(days=365) curdate = str_to_datetime(strdate) return datetime.datetime.strftime(curdate +...

Update a field from other field with button

python,openerp,odoo,openerp-7

First you need to browse that record and than assign it's value to a field1. Try with this def button1(self, cr, uid, ids, context=None): field2 = self.browse(cr, uid, ids[0], context=context).field2 return self.write(cr, uid, ids, {'field1': field2}, context=context) ...

I can't find my module in Odoo

openerp,odoo,openerp-8

Track the following: checkout __init__.py, __openerp__.py files weather any server track-back appear or not find the path of addons module is your module is at same place or path? give read/write/execute permission for that module restart your server Go to browser, from GUI, Setting => Modules => Update Modules List...

how to create a function to raise error in openerp

openerp,odoo,openerp-7,raiseerror

You can add Add Python constraints like, @api.one @api.constrains('start_trip', 'start_business', 'end_business', 'end_trip') def _check_date(self): now = datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT) if self.start_trip and now < self.start_trip: raise exceptions.ValidationError("Entered Date Should be greter then Today") elif self.start_business and now < self.start_business: raise exceptions.ValidationError("Entered Date Should be greter then Today") elif self.end_business and now <...

Odoo IndexError: list assignment index out of range

openerp,odoo

You need to return a dictionary of dictionary for functional fields. You defined res as list and tried to assign as the dictionary. res[perfo.id] is considered as list and index value perfo.id is not found in the res list. That is what the error says. Now the code will be...

change existing filter string in OpenERP

openerp,openerp-7,odoo

If you only want to change the string of existing filter than use attributes for example: <record id="sale_order_list_select" model="ir.ui.view"> <field name="name">sale.order.list.select</field> <field name="model">sale.order</field> <field name="inherit_id" ref="sale.view_sales_order_filter"/> <field name="arch" type="xml"> <filter string="To Invoice" position="attributes"> <attribute name = "string">WON</attribute> </filter> <!-- After "Sales" filter it will add new...

Odoo, see fields in XML but in grey

python,xml,customization,odoo

Add the readonly attribute. You can do this either in your model or in the view (one of those in enough). Example of the latter: <field name="clicshopping_products_id" readonly="1"/> This won't change the fields color to gray, but it will made it uneditable, and that's what you ultimately want, if I...

How add more security policies to a password in ODOO(OpenERP)

openerp,odoo,openerp-7,openerp-8,odoo-8

If you take a look at the user definition, you can find the password field: 'password': fields.char('Password', size=64, invisible=True, copy=False, help="Keep empty if you don't want the user to be able to connect on the system."), In order to implement your desired behavior, create an 'onchange' method for the password...

Link a button to a python function from my model (Odoo 8)

python,model,odoo,odoo-8

If you want to call the python function on your button click you must have to set the same method name in your button name attribute and button type attributes as the object. I will give the small demo with you just check it with one your hand def main_val(self,cr,uid,ids,context=None):...

How can I check if a user is Manager for a specific module in Odoo?

orm,xml-rpc,odoo

And finally it's done : ) Following is my working code in python: models.execute_kw(db, uid, password, 'res.users', 'search',[[['id','=',userid],['groups_id.name','=','Manager'],['groups_id.category_id.name','=','Point of Sale']]],{}) ...

ODOO, calendar.event : bool have no attribute replace

python-2.7,calendar,odoo,odoo-8

Is your field used for 'display_start' on your view has a default value on your model ? I think it's because it returns False for this field you have this error. If it returns today, I think it will be ok....

Odoo 8 error when trying to open customer

openerp,odoo,openerp-8,odoo-8

in the searching of currency_rate_id, the search function is getting an empty list and you are trying to select the first element from the empty list which causes the error

How can I add new states for a country in OpenERP/Odoo?

openerp,odoo,odoo-8

States data are defined in res.country.state.csv file as you mentioned. You can define a new file like this one or just modify it respecting that format. To visualize your changes, don't forget to update base module (restarting server not enough). If you create a new file don't forget to add...

How to hide field depend on condition odoo?

openerp,odoo,openerp-8

The fields you use in attrs need to be present in the current view. You can add this field to model: class test_rule(models.Model): _name = 'test.rule' rule_id = fields.Many2one('test.list', required=True) type_test = fields.Selection(related='rule_id.type_test') ul = fields.Many2one('product.ul', string='Package Logistic Unit') And then to your form: <form string="Test Rules"> <field name="type_test" invisible="1"/>...

Backup Odoo db from within odoo

python,openerp,odoo

By using this module you can backup your database periodically https://www.odoo.com/apps/modules/7.0/crontab_config/ (v7) you can also test this module https://www.odoo.com/apps/modules/6.1/db_backup_ept/ (v6 it can be miggrated to v7) in your case you can add button to execute the function that will be executed by the schedular....

OpenERP / Odoo using domain for many2one in xml view

odoo,odoo-8

you may make related field for it and than add field on a attrs after than it will work fine. For example: 'category': fields.related('m2_id', 'category', type="char", relation='target_table_name', readonly=True, string="Category"), now use in xml like <field name="m2_id" /> <field name="category" invisible="1"/> <field name="option" attrs="{'invisible': [('category','=','val1')]}" /> ...

OpenERP - bringing related field from another table into tree view

openerp,odoo

try with this code: class mrp_bom(osv.osv): _inherit = 'mrp.bom' _name = 'mrp.bom' _columns = { 'x_nk_default_code': fields.related('product_id', 'default_code', type='char', relation='product.product', string='Part Number', store=True, readonly=True), 'x_nk_class_desc': fields.related('product_id', categ_id', 'name', type='char', string='Class Description', store=True, readonly=True), } Here is an example of related field in Odoo. ...

OpenERP - which field is getting the value from overridden name_get() function?

openerp,odoo

The name_get method is used to display value of a record in a many2one field. For example, in a sale order line, if you select a product, the value displayed in the sale order line for the field 'product_id' must be the result of the 'name_get' on the product.product object....

Response time is delayed when we have multiple requests in oodo server or openerp?

python,python-2.7,openerp,odoo,openerp-8

The Odoo server can process only one request at a time. This means that other request have to wait until they are processed. The solution is to run Odoo in multiprocess mode, where several workers can handle requests is parallel (docs): Use the --workers=x option, where x is the number...

Odoo 8 what is best way to create records with reference to each other

orm,model,odoo,recordset

One likely culprit is the recomputation of the parent_left and parent_right fields. You could try disabling it by using a context with 'defer_parent_store_computation': True and then calling self._parent_store_compute(cr) when all the categories have been computed.

Why are odoo openerp changes to python files and view files not visible?

python,odoo

You need to run Odoo with the -u options for the changes to be applied: ./odoo.py -u changed_module_name ...

Getting error: TemplateAssertionError: no filter named 'n' when printing report?

python,templates,openerp,odoo

I just fixed this issue for our invoices. Odoo switched from Mako in v7 to Jinja2 in v8, with a "simulated" Mako notation where most things work as before. Inline Python code doesn't, this "n" filter doesn't. You have to switch from Mako's "|n" to Jinja2's "|safe" (this filter means...

change color background kanban in odoo

xml,openerp,odoo

You have a condition problem for orange test: ( ( record.eth_current_stage_deadline.raw_value gt new Date() ) and (record.eth_current_stage_deadline.raw_value - new Date() lt 3*86400000) ) Note that there are two comparisons like this: (date_val > today) and (date_val - today < 3 days) The value 86400000 = 24 * 60 * 60...

there is possible to related a related field?

field,openerp,odoo

try _columns={ 'sale_price_unit': fields.related('procurement_id','sale_line_id','price_unit',string='Prix de vente',type='float', store=True, readonly=True), } ...

odoo inherit more one template

python,templates,inheritance,odoo

In OpenERP, Sequence is matter when we inherit other class. So first we need to match that hierarchical. For example if any new object is define in other files and we inherit that class in another file than we must to load/import parent file first. So we never get that...

How list States of a Country in ODOO v8

odoo,odoo-8

In Odoo 8.0 new API the field itself use the related attribute in any fields. hear there have no any facility to add the separate field as related Just like this.. country_id = fields.many2one('res.country', 'Country') state_id=fields.many2one(related='country_id.state_id.id', store=True) I hope this should helpful for you .. :)...

How to set up an incoming email server for an user in Odoo?

openerp,imap,odoo,odoo-8,fetchmail

Finally, I've found the problem, which is very specific I guess, but who knows, may be this answer helps someone in the future. I've realized that the module fetchmail_attach_from_folder was installed in all the computers which were giving errors, on the contrary, it was not installed in those which there...

How to use a many2one field to display two fields together in OpenERP (odoo)?

openerp,odoo

You can use 'name_get' method to achieve this. def name_get(self,cr,uid,ids,context=None): result = {} for record in self.browse(cr,uid,ids,context=context): result[record.id] = record.name + " " + record.lastname return result.items() Following is just an example: There is a model 'sale.order', in that there is a model 'res.partner' as many2one. So let's say you...

How to call the website side widget in odoo

javascript,odoo,odoo-8

First when you create widget it will automatically render above xml file that you mention in first line so below line render the another widget template xml file $(Qweb.render("fb_shared_post", {'res':'Hello'})).prependTo('<TemplateDivID or Class>'); ...

RML report openerp 7

openerp,openerp-7,odoo,openerp-8,rml

We can track from the Source Document In report.py we need to make a function and pass origin in it. def __init__(self, cr, uid, name, context): super(your_report_calss_name, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, 'get_cust_ref_val': self._get_cust_ref_val, }) This method will check like origin is SO or PO or OUT/###:SO### or...

Getting TypeError: type() argument 1 must be string, not None

python,openerp,odoo

You missed required module descriptor on model. try to _name or _inherit on your model class. It will resolve this kind of error....

Add a custom parser for QWeb report

python,openerp,odoo,odoo-8

Check the method argument while you are calling the method in Qweb View. def _hello_world(self, field): return "Hello World!" the above function uses some argument as field but you can try to called that function something like this. <?xml version="1.0" encoding="utf-8"?> <openerp> <data> <template id="ig_account_object_printout_report_template"> <t t-call="report.html_container"> <t t-foreach="docs" t-as="o">...

how to display openerp error message

python,openerp,openerp-7,odoo

raise osv.except_osv(('Error'), ('Error Cannot Edit')) ...

Get post save event in Odoo

events,openerp,odoo

I solved it myself. I manually copied connector module from github to /usr/lib/python2.7/dist-packages/openerp/addons (to make sure it's in my IDE's libraries' path). Installed the connector from Settings -> Local Modules. Used the following code (can be anywhere, even in __init__.py of your module) @on_record_create(model_names=['res.users', 'res.partner']) @on_record_write(model_names=['res.users', 'res.partner']) def delay_export(session, model_name,...

OpenERP - related field returns empty rows

openerp,odoo

my odoo installation is a little different, but this (adapated to your case) works for me : 'x_nk_class_desc': fields.related('product_id', 'categ_id', 'name', type='char', string='Class Description', store=True, readonly=True), the two changes I did are : removing relation='product.category' : from this I get (maybe wrongly) that it's only useful if the last term...

How to create a summary table of an one2many table in OpenERP7?

python,xml,openerp,odoo,openerp-7

I've just found a solution!! The problem arose when I clicked on the button Close, Discard or Save, the popup was closed and the function field of type="one2many" had no time to be reloaded. So I added an option to the function field: <field name="summary" options="{'reload_on_button': True}"> <tree> ... </tree>...

How to apply a loop in xml report for odoo 8?

xml,openerp,odoo

U want to use for loop in qweb report ? Example: <tr t-foreach="get_payslip_lines(o.line_ids)" t-as="p"> <td><span t-field="p.code"/></td> <td><span t-field="p.name"/></td> <td> <t t-if="p.amount &lt; 0"> <span t-esc="formatLang(-p.amount, currency_obj=o.company_id.currency_id)"/></t> <t t-if="p.amount &gt;= 0"><span t-esc="formatLang(p.amount, currency_obj=o.company_id.currency_id)"/></t> </td> <td> <t t-if="p.total &lt;...

Using popup window to get user inputs and use those inputs in button's function in OpenERP

python,openerp,odoo

There is no need to inherit from product.template. Just make a one2many field referencing the template you want to change. Also, it seems like nk.product.template should be a TransientModel and not a normal model. Objects of transient models exist only temporarily and are not indefinitely stored in the database. They...

Can't setFont(Times-Roman) missing the T1 files?

python,openerp,reportlab,odoo

After the R&D i found the solutions for this... and its work for me... -> This error is also post in bugs.debian.org, and patch is provide to avoid this error. -> And another solution is (I prefer this one): Download this pfbfer.zip, and extract it. Now put all the files...

odoo:get unit price from an other table

python,odoo

I actually just finished something similar. I did it using @api.onchange so for your purpose the function can look like this: @api.onchange('product') def product_changed(self) self.price = self.product.price In the view just display the fields....

how can i add a report record in openerp odoo?

report,odoo,openerp-8

In General Directory file structure for creating the Qweb Report in ODOO report directory file contain __ init __.py file which is use as the manifest file for any python module its kind of entry point of the python module. (add the entry point of the your_report_parser_class_file.py file) your_report_parser_class_file.py file...

Button to Open Product Record in Tree view

openerp,odoo

Here ids[0] will give you id of bom line, and in bom line there is reference of product.product not product.template. so if you wanted to open a product you need to write a method like, def open_product(self, cr, uid, ids, context=None): rec = self.browse(cr, uid, ids[0], context) return { 'type':...

How can I remove “Powered by Odoo” on odoo 8.0 (OpenERP)?

odoo,openerp-8

First go to your Odoo web module and open below file. addons => web => views => webclient_templates.xml Now find this tag <div class="oe_footer"> and put it comment like. <!--div class="oe_footer"> Powered by <a href="http://www.openerp.com" target="_blank"><span>Odoo</span></a> </div--> Hope this will solved your problem....

Using domain in Odoo colors attribute

xml,odoo,openerp-8

Yes we can use multiple condition on colors with the help of and and or for example: colors="blue:state=='approved' and doc_type=='revisi' " colors="blue:state=='approved' or doc_type=='revisi' " ...

OpenERP, Aptana - debugging Python code, breakpoint not working

python,openerp,aptana,odoo

It could happen if you run your server in "run" mode and not "debug" mode. If you are in "run" mode the breakpoints would be skipped. In Aptana, go to the "run" -> "debug" to run it in debug mode.

Add element in an inherited view (Odoo 8)

xml,view,odoo,odoo-8

If we want to add new field or any new element on parent view than we need to specify it's position. Means this new field or new element will be shown in view. So in your case try with this: <record model="ir.ui.view" id="view_bill_clients_form"> <field name="name">bills.clients.form</field> <field name="model">res.partner</field> <field name="inherit_id" ref="base.view_partner_form"/>...

install dependency in Bitnami Odoo Stack

python,odoo,bitnami,cups

To install an internal dependency in bitnami Odoo stack: Go to /../odoo-8.0-6/python/bin/ Run from there the executable "python2.7" (Do not run native python shell. i.e. from command prompt or terminal.). Instead run python shell from above directory. In Python type: from subprocess import call call("pip install your_dependency_name",shell=True) e.g call("pip install...

Odoo8 Qweb generated pdf document. The tablerows on the 2nd page are jammed

pdf,report,wkhtmltopdf,odoo,qweb

Hear it means that the current Report not using the compatible version of Wkhtmltopdf python library you need to check from version of current Wkhtmltopdf python library and if it 0.12 to lower remove and reinstall then install the latest Wkhtmltopdf 0.12.X version or later and print your report again....

Odoo8 - how can I sort status bar and set default as new?

default,statusbar,odoo,odoo-8

When you declared your field you gave it a set of options instead of a list of options. Sets in Python doesn't keep the information about items order, but lists do. For your declared order to be respected you just need to replace the set literal by a list literal:...

Bold IN List View Odoo

customization,odoo

You can use in to choose from multiple values: fonts="bold:task_name in ('PLANNING AND DESIGN', 'DEVELOPMENT')" The following alternative approaches would also work, but in this particular case using in is preferable (as it is much clearer and shorter). Using or: fonts="bold:task_name == 'PLANNING AND DESIGN' or task_name == 'DEVELOPMENT'" Chaning...

Inherit product save method

openerp,odoo,odoo-8

Try Following and add your custom code either before to the return statement or catch the result of super somewhere and add your code after that and return the changed result, do not forget to return from the method. from openerp.osv import osv class lcd_update(osv.osv): _inherit = 'product.product' def create(self,...

How to show and align label for a field on a form in OpenERP?

xml,openerp,odoo

Fields placed inside a <group> XML element will display labels by default. <field name="arch" type="xml"> <group> <field name="default_code" string="Item Number" readonly="1" invisible="0" /> </group> </field> ...

how i know who is the active user in odoo 8

openerp,openerp-7,odoo,openerp-8,odoo-8

You should use record rules and add following rule for sale.order model [('create_uid', '=', user.id)] user object keeps info about current logged user....

When to use api.one and api.multi in odoo | openerp?

openerp,odoo,openerp-8

Generally both decoarators are used to decorate a record-style method where 'self' contains recordset(s). Let me explain in brief when to use @api.one and @api.multi: 1. @api.one: Decorate a record-style method where 'self' is expected to be a singleton instance. The decorated method automatically loops on records (i.e, for each...

Powered by Odoo footer

odoo,openerp-8

First go to your Odoo web module and open below file. addons => web => views => webclient_templates.xml Now find this tag <div class="oe_footer"> and edit it like <div class="oe_footer"> Made by <a href="http://www.openerp.com" target="_blank"><span>Odoo</span></a> </div> Save it and refresh your browser. Hope you get what you want....

odoo, see id and nt the name in dropdown

python,xml,field,odoo

You need to declare which field is used for the object name, using the _rec_name attribute. In your case: class clicshopping_manufacturer(orm.Model): _name = 'clicshopping.manufacturer' _rec_name = 'clicshopping_manufacturers_name' # ... Alternatively, you could just rename clicshopping_manufacturers_name to name, since name is the default value for _rec_name. I'd choose the second option,...

Adding icons to menu items in odoo

odoo,odoo-8

AFAIK displaying icons in menu items is deprecated and does not work on the web client. Probably the to achieve you would need to create a module for the web client extending it with that capability.

Add column to BOM lines in OpenERP v8

python,xml,odoo,openerp-8

You have added the field product_qty_available in the model mrp.bom and you are trying to add the field in the inside the field bom_line_ids - in the tree view of bom_line_ids which is one2many of mbrp.bom.line, so system tries to find the field product_qty_available over there in mrp.bom.line model which...

Automatic user creation in odoo8 when custom record created using inheritance by delegation

python,inheritance,openerp,odoo

Lets take an example. Suppose I have created a TestModel. class TestModel(models.Model): _name = 'test.model' name = fields.Char('Name', required=1) email = fields.Char('Field') user_id = fields.Many2one('res.users', 'Related User') Now I wanted to create a user when the record of test model is created. so I will modify the create method of...

Add(Sum) two values in odoo

openerp,odoo

you can achieve this by onchange method, here is a demo of onchange method using new api of odoo. class DemoModel(models.Model): _name = 'demo.model' field_x = fields.Integer('Column X') field_y = fields.Integer('Column Y') field_sum = fields.Integer('Column Sum') @api.onchange('field_x', 'field_y') def onchange_field(self): if self.field_x or self.field_y: self.field_sum = self.field_x + self.field_y you...

How to fetch Calendar (calendar.event) meetings for particular date in ODOO?

openerp,odoo,openerp-8,odoo-8

You are accessing the Odoo External API. The read method is to be used when you know the id for the records to fetch. To get records based on a condition you should use search_read and pass it a domain expression instead of the record ids. As an illustration, the...

Change the order of Form, Tree views in Odoo, OpenERP

openerp,odoo

First We Need to change the Order of the ir.actions.act_window and see Below Sample Demo for the customer(partner) <record id="base.action_partner_form" model="ir.actions.act_window"> <field name="name">Customers</field> <field name="type">ir.actions.act_window</field> <field name="res_model">res.partner</field> <field name="view_type">form</field> <field name="view_mode">tree,form,kanban</field> <field name="domain">[('customer','=',1)]</field>...

How to change the odoo language?

openerp,odoo

You need to install the additional languages on the Settings menu. Login as admin and make sure you have the Technical Features enabled (On user admin, Access Rights tab, Technical Features checkbox). On the Settings | Translations | Load a translation menu option you open a wizard to select and...

how to add a related field many2one?

field,openerp,odoo

You have used wrong model in inherit it should be as follows: _inherit= 'stock.picking' _columns={ 'user_id': fields.many2one('res.users', 'user', select=True), } _inherit= 'stock.move' _columns={ 'user_id': fields.related('picking_id', 'user_id', relation="res.users", type='many2one', string="user", store=True, readonly=True) } ...

Where OpenERP (Odoo) finds the modules path?

openerp,odoo

You can add to the addons_path directive in openerp-server.conf, (separate paths with a comma) or you can use --addons= if starting your server from the command line.

how to join more then two table in postgresql?

sql,postgresql,postgresql-9.2,odoo,pgadmin

[USING @Patrick 's cleaned up code] Most probable cause is that an 1:N relation exists between orders and order_lines, causing the orders with multiple order_lines to be included in the sum() more than once. SELECT to_char(o.date_order, 'DD-MM-YYYY') AS date_order , sum(o.amount_total) AS amount FROM public.sale_order o WHERE EXISTS ( SELECT...

Is there a way to edit the title of live support chat in Odoo

odoo

change the Text of the button field value. ...

How to order by a boolean field in Odoo?

order,openerp,odoo,odoo-8,kanban

One method I use to to odd sortsis use the context to control it. In the window action for the kanban view, add a context like <field name="context">{'do_my_special_sort': True}</field> and then on the model, override the search method, check for this flag in the context and set the sort order....

Odoo status bar glitches when I reload the page using browser refresh page (F5)

html,css,openerp,odoo,odoo-8

You need to do this(small change in xml file)... and its work like charm. Put all code between <div> --put your code here-- </div> Here, i'm not putting your whole code structure, but you only put all your <button> and <ul> tag between <div></div>. So, your code looks like this......

Improve SQL statement with Index Scan Backward

python,performance,postgresql,odoo

You can create a selective index for the specific query, something like CREATE INDEX idx_order_messages on mail_message (id) where model = 'purchase.order' A smaller index results in fewer reads etc, so it must be faster....

Odoo - how to properly copy views from other model

inheritance,view,odoo,openerp-8

You need to specify which view to open for which view mode. Because when you copy another model's view, it seems it does not find correct view automatically (even if only one is defined for each mode) <record model="ir.actions.act_window.view" id="action_my_model_template_tree"> <field name="sequence" eval="1"/> <field name="view_mode">tree</field> <field name="view_id" ref="view_my_model_template_tree"/> <field name="act_window_id"...

Automated Action Birthday =19

python,orm,openerp,odoo,openerp-8

it might not be the brightiest way, but you should be able to do something like this : def get_age_comp(self, cr, uid, context=None): cr.execute('DELETE FROM stat;') cr.execute('''INSERT INTO stat(name, age) SELECT name, date_part('years',age(birth_date)) FROM fci_student WHERE gender='m' AND date_part('years',age(birth_date)) > 18;''') if you don't want to drop existing stat rows...

Change a many2one field content in onchange from another field?

openerp,odoo,openerp-7,odoo-8

def onchange_client(self,cr,uid,ids, client_id,sale_orders_ids,context=None): res={} order_obj = self.pool.get('sale.order') order_ids = order_obj.search(cr,uid, [('partner_id','=',client_id)]) logging.info('LIST OF SALE ORDERS OF SELECTED PARTNER') logging.info(order_ids) return {'domain':{'sale_orders_ids':[('id','in',order_ids)]}} you can do it with set domain on many2one field....

Where is the match validation for reset password in OpenERP [V8 Odoo]

python-2.7,openerp,odoo,openerp-8,odoo-8

I just searched for "passwords do not match" and IntelliJ took me to addons/auth_signup/controllers/main.py:116. This is where an assert is introduced to check if the passwords match. The simplest thing would be to add an assert with your custom message, following their example. Good luck!...

I can't identify which class have this errors (odoo)

python,orm,openerp,odoo,openerp-8

It's very hard (verging on impossible) to answer without seeing your actual code. The problem is clearly in _inherits definition in one of your models. Most likely you mixed up _inherits and _inherit. While the later one can be a either a list or a single string, _inherits has to...

Pycups on Bitnami Odoo Stack

python,odoo,cups

Refer pycups Documentation. As there is no available package for Windows right now, You can not run in windows machine. Try in Mac OS or any *NIX environment. You can not install linux packages into Windows!...

bootstrap-less was not found When ODOO Theme Change?

openerp,odoo

When This Type is Problem Occurred Then Following Command in your Terminal Most simple way is to install nodeJs with its package manager npm. Nodejs is in the repositories, but that one is a bit outdated, instead you could use this ppa: sudo apt-add-repository ppa:chris-lea/node.js sudo apt-get update sudo...

filter tree view of header model on base of values of the detail model

openerp,odoo,openerp-7

You want to filter the purchase_approval_item tree to have only the records where the approved_by_ids one2many field contains a certain a user - probably the current one. You should have a search view for your purchase_approval_item model, with: <filter domain="[('approved_by_ids', 'in', [uid])]" name="filter_my_approvals" string="My Approvals" /> ...

any way to format date with function field odoo?

date,field,openerp,odoo

I solved as : def _format_date(self, cr, uid, ids, field_name, arg, context=None): res = {} for line in self.browse(cr, uid, ids, context=context): print line.id,'date ',str(line.date).replace(',','.') if line.date: res[line.id]=line.date.split()[0] return res _columns={ 'date_fin': fields.function( _format_date,method=True, string='date fin',type='date', store = { 'stock.move': (lambda self, cr, uid, ids, c={}: ids, ['sale_price_unit','product_uom_qty'], 10), },...

Get deleted records id's from ODOO Sever

openerp,odoo,openerp-7,openerp-8,odoo-8

There is no any API or any method to fetch out deleted records from Odoo. So, you have to manage other way. Like deleted_ids = set(mobile_ids)-set(Odoo_ids)...

How to create Task ( project.task ) under specific customer (res.partner ) in ODOO?

ios,openerp,odoo,openerp-7,openerp-8

You do not describe how you are interfacing with Odoo, but I looks like you are using some library performing XML-RPC calls. The create() API function accepts a dictionary with the data for the new record to be created. It looks like that the dictionary after the create, argument should...

OpenERP - Python development environment

openerp,odoo

Eclipse + PyDev convenient for OpenERP/Odoo-Python. For quick computations, apply patches, Idle is great. Also Aptana Studio (http://www.aptana.com/) is good and it's alongside GIT to have local version control. It is easy to either deploy locally or push the changes to a remote GIT repo. here is good anwer given...

Send notification for specific group in odoo

python,odoo

First of all you need to use partner's id, not user's id. Second of all you need to add all users, not only the first one. This is a code based on what I use in my project to create an array that can be used as a value for...

Get and set text in a xml field

xml,odoo

i don't know if anyone have the same problem as I but the solution that i found was to add a warning to the return instead of the raise osv.except.... ... for vat,nam,estado in registos: if estado == 'open' or estado == 'paid': result['name'] = nam return{'value': result, 'warning':{'title':'warning','message':'Não pode...

Odoo - Impossible to extend stock.view_picking_form view

openerp,odoo,openerp-8

I did not add 'stock' in my depends __openerp__.py file. It is possible to check this by looking at the file or executing this query : select * from ir_model where model='stock.picking' select * from stock_picking ...

Is there any way to call a function when a record is requested to be shown in a form view?

openerp,odoo,odoo-8

You can use function field. Function is called when the form loading and at the time of new record creation before and after. When you create a new record this function field will take value as a William and after saving value will change and become odedra Here is example...

Odoo Prefilter many2one / many2many / one2many

orm,model,odoo

That's what domain is for: To have the selectable list filtered by type 'external' add: domain=[('type', '=', 'external')] You can set the domain either in the field definition (python file) or in the view field (XML file). The actual filter is done by the view; if you set the domain...

OpenERP - field not showing in a tree view

openerp,odoo

The product_uom field has a groups="product.group_uom" attribute. This makes it visible only to the users in that Group. Either remove it from the tree definition, or make sure your user in in that group. Probably what you need is just to activate the "Allow using different units of measures" feature...

How to pass field value from main view to popup window in OpenERP?

openerp,odoo

You need to write default_get in that pop-up object. try with this, def default_get(self, cr, uid, fields, context=None): product_obj = self.pool.get('product.product') record_ids = context and context.get('active_ids', []) or [] res = super(product_product, self).default_get(cr, uid, fields, context=context) for product in product_obj.browse(cr, uid, record_ids, context=context): if 'default_code' in fields: #in 'default_code' is...

odoo v8 - Field(s) `arch` failed against a constraint: Invalid view definition

python,xml,view,odoo,add-on

You have made silly mistake in defining _columns. _colums is not valid dictionary name for fields structure. Replace this by _columns and restart service and update module. ...

How to install new module in OpenERP 8.0?

openerp,odoo

You need to: Choose "Users" from the menu Click the current user, and edit it by checking "Technical features" Refresh the page Click the "Update module list" menu item. ...