odoo-view

How to organize many2many checkboxes in lines (rows) rather than columns?

独自空忆成欢 提交于 2021-01-28 03:03:03
问题 I am creating one module where I have a Many2many field and I would like to convert it into a checkbox group. I have written this in my XML view to achieving it <field name="location_ids" widget="many2many_checkboxes"/> But the field is shown all the options in a long column. I would like to show the options in multiple rows as in the following image: 回答1: I think I have found a good approach for you. Research First I have search the original template which is rendered with the widget

How to organize many2many checkboxes in lines (rows) rather than columns?

我的未来我决定 提交于 2021-01-28 00:47:43
问题 I am creating one module where I have a Many2many field and I would like to convert it into a checkbox group. I have written this in my XML view to achieving it <field name="location_ids" widget="many2many_checkboxes"/> But the field is shown all the options in a long column. I would like to show the options in multiple rows as in the following image: 回答1: I think I have found a good approach for you. Research First I have search the original template which is rendered with the widget

how can i use function value in Domain filter

断了今生、忘了曾经 提交于 2020-01-06 15:25:16
问题 I am getting current login user id by following function def _get_user_name(self, cr, uid, *args): user_obj = self.pool.get('res.users') user_value = user_obj.browse(cr, uid, uid) return user_value.id or False and now i want to use its value in this field's Domain like .... x_trainer_id = fields.Many2one('res.partner', string='Trainer',domain=[('user_id.id','=','get_user_name')]) How is it possible? I'll be very thankful.... 回答1: you can do it as below: x_trainer_id = fields.Many2one('res

Not able to add the group sale_manger to action_invoice_cancel button

烂漫一生 提交于 2020-01-06 14:33:42
问题 I want to add sale_manager group to the action_invoice_cancel (Invoice Cancel) button in the customer invoice . My aim is to see that button only for the users in the sale_manager. I tried like this : Code <?xml version="1.0" encoding="utf-8"?> <odoo> <record id="orchid_invoice_cancel_request_inherit" model="ir.ui.view"> <field name="name">invoice_cancel_request</field> <field name="model">account.invoice</field> <field name="inherit_id" ref="account.invoice_form"/> <field name="arch" type=

How to generate a report in excel (xls, xlsx) format on ODOO?

南楼画角 提交于 2019-12-30 10:23:09
问题 In purchase module, I want to generate the details which is being printed in the purchase order button as a pdf report. My requirement is how to print the report in excel format in odoo 10? 回答1: You can export the current tree view as an excel file with this module: web_export_view Or you can build your own excel report with this other modules: report_xls report_xlsx There are modules that already use the report_xls module, but you can look for them in the Odoo Apps or in the OCA repository

dynamicly hide fields and rows in tree view odoo 9

浪子不回头ぞ 提交于 2019-12-25 07:32:56
问题 I have model to store training results for athletes and tree view to insert results from model code is : class GeneralFitnessDetails(Model): _name = 'general_fitness_details' generalFitnessDetails = Many2one("general_fitness") player = Many2one('player') exercise = Many2one("exercise") exercise_state = Selection([('by_reps', 'By Reps'), ('by_time', 'By Time'), ('by_distance', 'By Distance'), ('by_weight', 'By Weight')]) reps = Integer(string='Reps') time_sec = Integer(string='Seconds') weight

Odoo 11.0 modules: Missing dependencies: (2) [“web.form_relational”, “web.form_common”]

£可爱£侵袭症+ 提交于 2019-12-24 08:59:55
问题 I'm using the project_team module for my instance, and I'm getting this warning in the browser console: Non loaded modules: ["project_team.form_rel"] . Searching deep in the module i found that the origin of this problem in this: Missing dependencies: (2) ["web.form_relational", "web.form_common"] I could see that those modules are present in odoo 10.0 and it's not in 11.0. I think it requires an update, but i cannot find any information about how can we replace this two old modules in the

Show to be deleted items in popup window

柔情痞子 提交于 2019-12-24 03:19:23
问题 I am using Odoo 10e. I want a simple functionality that whenever i wanted to delete one or more then one item from a list view or from a specific list view only. I want to show all of the items which are selected for deleted to show their name in popup window so that user can have a quick review what's he is going to delete. I know user can see details in list view but i want to give a glimpse to user in shape of model window that this is going to be deleted. Are you sure to delete ? If user

Odoo disabled edit button depending on state

一世执手 提交于 2019-12-24 00:21:35
问题 this question already asked by someone, this in an example question How to hide the edit button form only when invoice' state is 'paid' Odoo v8? but i dont get true answer, somebody can help me, i really need to hide or disabled this button. For your information im using odoo v.10 Thanks in advance 回答1: The only way to this is by Javascript you need to add this behavior to your form view build a custom addon and just add this javascript file to your backend assets template //file: static/src

Odoo throws a MissingError On treeview Second line record

醉酒当歌 提交于 2019-12-20 05:15:52
问题 How can i solve this error Odoo throws a MissingError on TreeView Second line button when clicked . The first Record line works but i need such that for each record on the tree the code below will be able to pass the contexts and open the appropriate view . Kindly assist Here is the code called on the button @api.multi def action_four_weeks_schedule_form(self): self.ensure_one() res = {} ids = self._ids cr = self._cr uid = self._uid context = self._context.copy() for id in self.browse(self