Odoo / Openerp - Create date on customers tree view

I am trying to add the create_date field in my regular Customer Tree view. Since I am new on Odoo or Openerp, I am using the developer mode, and I went to Settings/User Interface/View and I selected the view res.partner. The following code can be edited: <?xml version="1.0"?> <tree string="Contacts"> <field name="name"/> <field name="function" invisible="1"/> <field name="phone"/> <f

Odoo First Expiry First out in OpenERP

I wanted to bring batch number selection to be in sales module and to enforce any sales done according to the expire date associated to product automatically. The idea is a user select product and quantity to sale, and the system expected to do selection from the right batch, if there is no enough stock available it must does splitting So far what I managed to do: Product are sorted by expired date and it automatically selects a product with recent expiry date without any user intervention an

How to override fields_view_get of TransientModel in odoo 10?

I already did it and in older odoo version this way it worked! Cant see this 'kecske' signal in the log file. No error message. If I wrote some code before super, it hasn't any effect. Any idea? Is it the right way? class DemoWizard(models.TransientModel): _name = 'demo.wizard' name = fields.Char(string='Name') @api.model def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False): log = logging.getLogger('demo.wizard.fields_view_get()')

Fetch images which are stored in filestore odoo 11

How can I Fetch images which are stored in file-store odoo-11? I am trying to fetch the product.template image, which is stored in ir_attachment in the format 39/39abfeca081b17a6b93fbeaeead3e34025a39f9c. This is not a binary code. I tried this code in this URL. It didn't give any image. Later, I understood that this is a code in file store. When we download a Database in zip format and extract the DB we will see the file-store inside this folder "39" is a folder name and 39abfeca081b17a6b93fbe

Methods in Odoo Studio

I know to make a method in odoo and how to call the method through a button but with odoo studio I am not finding features in make a method and call it through a button. So my question is How to make a method in Odoo studio and call it through a button?

How can i get Amount in word in odoo 10

How can i get amount in words in invoice in odoo-10. I have added following code in account_invoice.py @api.multi def amount_to_text(self, amount, currency): convert_amount_in_words = amount_to_text_en.amount_to_text(amount, lang='en', currency='') convert_amount_in_words = convert_amount_in_words.replace(' and Zero Cent', ' Only ') return convert_amount_in_words xml t-esc="o.amount_to_text(o.amount_total, o.currency_id)" /> I got the followi

Odoo record rule based on previous value

I need to create Odoo Record Rules to make sure a state field progressing according to allowed step. allow => 'approved_by+manager' > 'approved_by_senior_manager' denny => 'approved_by_manager' > 'approved_by_finance' How to create such rule on Odoo Record Rules?

get email body with html format in odoo

I want to get email body from in html format, defaults = { 'name': msg.get('subject') or _("No Subject"), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'partner_id': msg.get('author_id', False), 'description': msg.get('body'), } I want to get email body to description but when I use 'description': msg.get('body'), it takes all on text format, I want to get email body on HTML format

How do I hide navbar and root-menu at sidebar from Odoo's web-backend module?

I am working on POS Point of sales module, I am opening an Iframe in mobile device to show POS screen but I wanted to hide navbar and sidebar of root-menu items, so normal users can use only POS dashboard. I have installed POS_Mobile snippet to make it responsive on mobile phones and there I tried writting JS code to hide it. but it's opening only when I start any POS-session by clicking on resume. I tried as: In file pos_mobile_template.xml, adding JQuery as: if ($(window).width() < 76

Odoo datetimepicker on the website show only year

I'm trying to add datetimepicker on my website form, but i need to view only year. Here's my code <div class="input-group o_website_form_date" t-attf-id="date_start" data-target-input="nearest"> <input type="text" class="form-control datetimepicker-input o_website_form_input" t-attf-data-target="#date_start" name="date_start" id="date_start"/> <div class="

How to add a domain to a Many2one field in Odoo?

I have a custom module to manage students and groups, each group has a list of members (student_ids) and a president (manager_id). The manager should be selected among the list of members. So was traying to add a domain to manager_id field domain="[('id','in',self.student_ids.ids)], so the user can only select a manager from the existing list of students. But that code is giving me an error. What should I do to add that domain to the manager_id field? class Groups(models.Model): _name =

Odoo Search view domain error

There is an odoo system with a timesheet module (self-made) in it. I've made 2 groups of search view filters: years and months: <!--Timesheets-ALL Tab search view--> <record id="view_tabel_search3" model="ir.ui.view"> <field name="name">tabel.tabel.search3</field> <field name="model">tabel.tabel</field> <field name="type">search</field> <field name="arch" type="xml"> <search

Passing recordset to object in template from controller Odoo

I have a form in Odoo website which has country and state selection fields. This form is populated from a controller where I pass a recordset of all the states and countries as values in a dict with states and countries as keys. Now for the selection field, it is looped using t-foreach through states to provide the option and values. Now upon selection of country, I need to be able to filter out the states of that particular country. Is this possible and if yes how? Here is some of the code whic

Odoo 10 - Default value for field based on condition

I am extending stock.picking to modify the default value used as location_dest_id. Standard definition is: location_dest_id = fields.Many2one(¬ 'stock.location', "Destination Location Zone",¬ default=lambda self: self.env['stock.picking.type'].browse(self._context.get('default_picking_type_id')).default_location_dest_id,¬ readonly=True, required=True,¬ states={'draft': [('readonly', False)]})¬ Which basically uses the default location defined in the picking_type. I have exte

Odoo How to get Product name with single Attribute e.g: Product1(color)

Req is i have created a Product called Product1 and i have given 2 attributes for that i.e. color,fitting,size. I have defined a field in sale.order product_id = fields.Many2one('product.product', string="Product") As per the standard we are getting Product1(color,fitting,size) My req is i need to get only one attribute i.e. Product1(color) I tried to do override in name_get function it is not getting. Can anyone help? Thanks in advance

Traceback (most recent call last) Odoo V-8 custom module

I am new to the Odoo development and i am currently trying to the learn the basics and came across a problem. I am working on the Odoo Version 8. I am trying to install a diet facts module and i get the same error every time, i have tried switching browsers but to no avail. <?xml version="1.0" encoding= "utf-8"?> <openerp> <data> <record id= "dietfacts_product_template_tree_view" model= "ir.ui.view"> <field name="inherit_id" ref="product.product_templat

how to Solve it in odoo11

how to Solve The style compilation failed, see the error below. Your recent actions may be the cause, please try reverting the changes you made

Expose Odoo on internet after installed locally

Im wondering if you can help me to expose Odoo 14 on internet through a subdomain in my shared host. I've installed Odoo 14 on Ubuntu server on virtual machine and now i want to expose Odoo on internet. I have installed nginx on ubuntu and configured it successfully. (Maybe im wrong here :/) Till now I can access my apache server from guest to host successfully but localhost with another port, for example odoo port 8069 it is impossible. I tried different adapters from guest to host as nat, brid

Removing records on module upgrade on OpenERP / ODOO

I have an application module that have loaded employees for database initialization with custom data in a previous module release: <?xml version="1.0"?> <openerp> <data> .... <!-- John Smith --> <record id="emp_john_smith" model="hr.employee"> <field name="name">John Smith</field> <field name="company_id" ref="base.main_company"/> <field name="department_id" ref="dp_production"/&g

Odoo Computed Selection field doesn´t work

I am trying to create a Selection field where the values should be computed dynamically. The declaration is: payment_mode = fields.Selection('_compute_selection', string="Payment mode", default="cash") And the function: @api.model def _compute_selection(self): context = dict(self._context or {}) active_ids = context.get('active_ids') active_model = context.get('active_model') invoices = self.env[active_model].browse(active_ids) type_payment = MAP_INVOICE_TYPE_PARTNER_TYPE

Odoo Tree view by default in Inventory

In Sales when I go to Product menu I get tree view by default. I did it like this <record id="product.product_normal_action_sell" model="ir.actions.act_window"> <field name="view_mode">tree,form,kanban</field> </record> <record id="product.product_template_action" model="ir.actions.act_window"> <field name="view_mode">tree,form,kanban</field> <field name="view_id" ref="product.product_template_tree_

Odoo Domain in read_group method

There is standard method def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False) I'm calling a super on it and passing a domain like this [('end_date', '>=', '2019-05-01'), ('end_date', '<=', '2019-05-30'), ('employee', 'in', [49]), ('state', 'in', ['done'])] and it works. but when I try to append domain.append(('&')) domain.append(('state', 'in', ['progress'])) I get File "/home/www/workspace/openerp-7.0-20140804-231303/o

Odoo How to copy all fields's value from one record into another?

I have a existing record A and I want cover its value from record B. In regular way, we use A.write({'filed1':RecB's_value,...}) to update. But the number of fields near 400, I was wonder that if there is a convenient way to do that. I have tried that as code below copy = rec_b.copy() rec_a.write({copy}) got error AttributeError: 'yc.purchase' object has no attribute 'pop' I expected that can instead my manual assignment.

Odoo How to check the current URL in qweb?

I would like to check current URL in qweb to change the text in a button. I am working in an online store based in Odoo 11.0 community <button t-if="current_URL ==/shop">Filters OFF</button> <!--Since current_URL would be something like "/shop/category/laptops?filter=5-44" if there were any filters applied --> <button t-else="">Filters ON</button> I simply don't know if there is something like "current_url" or any other parameter/variable that qweb would underst

Odoo Understanding OpenERP Domain Filter?

I would like to ask you if you could please explain the anatomy of the Openerp domain filters. I have to use it my project. Please explain the description of the following domain filter. ['|',('order_id.user_id','=',user.id),('order_id.user_id','=',False)] I want to know the exact meaning of (order_id.user_id','=',user.id), what is order_id, user_id, and user.id. Are they referencing any table. If yes then how am I supposed to know which one... Basically I want to know decipher the notation

How can I see the emails address from marketing campaigns in Odoo?

I have sent some emailing campaigns form Marketing, at "Mass Mailings" at details I have "Emails" button. When I click on it I have columns "Mail ID (tech)", "Message-ID", "Sent" and others. But I do cannot see the email to which I have sent. How can I see the email, which I think is the most important information, because I cannot see which client has opened the email?

Odoo How to work with dynamic domain?

what I need is once I select patient when I search to select nameLab I wanna to show the only Lab that is related to the selected patient (patient_id should = patient). my classes: class labinvoice (models.Model): _name = "lab.invoice" order_line = fields.One2many('lab.order.line', 'order_id', string='Order Lines', copy=True) nameLab = fields.Many2one('medical.lab.patient',related='order_line.namelab') patient = fields.Many2one('medical.patient',related='order_line.patient_id'

Odoo 10 - Qweb iterate over all sale order lines and calculate total weight

I would like to iterate over all sale order lines and multiply product_uom_qty by product_id.weight for each product, then sum up all values to get the total weight of the sale order. I have seen a construct like this in sale order template: <t t-set="display_discount" t-value="any([l.discount for l in doc.order_line])"/> Which would be the equivalent to perform such aggregated multiplication over all lines?

Odoo Why RML Report is bigger when i generate it on Ubuntu vs MacOS

I work developing modules with Odoo. I have been presenting some issues when I try to generate an RML report. My development environment is set up on a Mac but my company's Odoo production server is on Ubuntu. When I print the report on my mac, the size is 7kb but when I do it on the Productions server is 47kb. Any thoughts?

Odoo Raise UserError only if none fields selected

I added my custom field to res.partner model and when I'm creating partner if branch_id is checked I want to that one of 3 fields should be selected. If some of the fields are not selected then I want to raise UserError. But now it raises UserError even if I one of the fields is selected. class ResPartner(models.Model): _inherit = 'res.partner' branch_id = fields.Many2one('branch.responsibility','Responsibility by branch') drawer_id = fields.Many2one( 'furniture.parts.type', str

Product quantity inside category Odoo

I would like to know how I could display the product quantity inside each category on my mega menu (odoo v14). We have the the following structure: Category 1 Subcategory A Product 1 Product 2 Subcategory B Product 3 Product 4 Category 2 Subcategory C Product 5 Product 6 We would like to display on mega menu (website) like that: Category 1 Subcategory A ( 20 products) Subcategory B ( 30 products) Subcategory C ( 40 products) Any idea, please ? Thank you

Odoo: How to hide a menu for certain group if the members are also members of another group

It's a bit complicated scenario .. I have users that are members of group 'Employee Officer' and at the same time are members of a new group 'Trainees'. I want the group 'Trainees' to have limited access and can't see all the menus available for 'Officer' group. But as the members of the limited group are members of the 'Officer' group they can see the same menus. How to hide menus from the 'Trainee' group and not from the 'Officer' group?

Odoo Auto generating a purchase order when a product (with quantity 0) is ordered

When the product has quantity on hand equal to zero, and customer orders this product, then, we need Odoo to generate a purchase order automatically for this product. Odoo is not generating the automatic PO. We have Odoo 8. As for an example, I created a test product. I ticked "Buy" check box, and unticked the"Make to order" check box. I added a vendor (has an address) on the product as follows: Supplier: Old Stocks - Delivery Lead Time: 0 - Minimal Quantity: 1.00 I also created a reordering

Sum in tree view odoo 9

I need sum row in tree view, and add where condition if is it possible! My tree view: row | field_1 | field_2 1 | 8 | Messi 2 | 8 | Messi 3 | 8 | Ronaldo 4 | 8 | Ronaldo How sum only for Messi and only for Ronaldo and get result 16 In below span I get 32 <span t-esc="sum(line.field_1 for line in doc.my_ids)" widget="float_time"/> Any solution? <span t-esc="Messi"/> 16 <span t-esc="Ronaldo"/> 16

Odoo How to compare two date fields with today's date and time

I have to write domain for checking that the present date and time is between two Datetime fields. I wrote the domain, but it shows this error: DataError: invalid input syntax for type timestamp: "date_from" LINE 1: ...OM "hr_holidays" WHERE (("hr_holidays"."today" >= 'date_from... ^ My domain is: <field name="domain">[('today','&gt;=','date_from'),('today','&lt;=','date_to')]</field> today = fields.Datetime(default=fields.D

How to group by a "custom field" in a search view? ODOO 10

I created a custom field called Commission in the product form (POS module). Its technical name is x_commission. I want to be able to group by "Commission" in the POS > Reporting > Orders menu. Is there a way to access that field from another view? Thanks in advance.

How to run Odoo 10 and 11.0 on same machine?

I installed python 2.7 and 3.4 on my local machine and on the server. Also installed Odoo 10. and 11.0 on the same machine. I created modules for Odoo 10 and 11, executed successfully. But when I upload Odoo 11 code to server getting an error. Example, the print statement I typed print'Test Print' in both Odoo 10 & 11.0. It worked without any error on the local machine. But got an error on the server. I checked the version on both machines, the output is: python -V Python 2.7.12 python3

Odoo statusbar widget for project.project

i'm trying to add a field to define statuses of project.project like: # -*- coding: utf-8 -*- from odoo import api, fields, models class Project(models.Model): _inherit = 'project.project' _name = 'project.project' state = fields.Selection( [('open', 'Open'), ('closed', 'Closed'), ('sleep', 'Sleep')], string='Status', default='open' ) Add added to the view in a heritage: <?xml version="1.0" encoding="utf-8"?> <odoo> <record id="edit_

How to show and save only one value on Odoo?

I have a model in which I created all the data types of Odoo, char, float, many2many…. etc, I show this model in a view where, depending on the type of data selected by the user, “only one” of these types of data will be shown to enter a value. I am showing the type of data selected by this domain in the view -> attrs = "{'invisible': [('fields_type', '! =', 'Char')]}" In addition, when “only one” of the fields is saved in the database, the other values in the line are in <null>. My q

How to display a dialog with warning message from controller in Odoo?

Is it possible to display a warning message when overriding a controller function? This is the code I have: raise Warning(_('Entered Quantity is greater than quantity on source.')) return super(CheckCart, self).cart(**post) I want to render the cart template but also raise a Warning, but I get the following: 500: Internal Server Error Error Error message: ('Entered Quantity is greater than quantity on source.', '') Traceback Without anything else.

In Odoo 13, my record rules are not working. If Globally this domain_force working fine

My question is User with this right should only see Sale orders of his warehouses. default_picking_type_ids is stock.picking.type. <record id="group_restrict_warehouse_user_smr" model="res.groups"> <field name="name">Order Management User</field> </record> <record id="so_restrict_warehouse_user" model="ir.rule"> <field name="name">Sale order restrict warehouse user smr</field> <fi

Odoo: How to depend on a field from a different model

I have a field two float fields I have added to the res.partner model. Now I have another completely different model that uses some parts of res.partner (i.e name, phone) but it doesn't inherit it. So what I would like to do is to update a field in my custom model anytime the two float fields I added in res.partner are updated. I tried using @api.depends but it doesn't seem to work with fields from a different model, although I have read otherwise.

  1    2   3   4   5  ... 下一页 共 5 页