odoo-8

How to filter many2one res.parner field in odoo

南笙酒味 提交于 2019-12-14 03:56:54
问题 I have x_trainer_id = fields.Many2one('res.partner', string='Trainer') field, and I want to filter data in it by the value that is put in category_id tag field in partner form . I want to show just those records in it their category_id tag value is defined Trainer. 回答1: If i understand this correct, try to define you field in your view like: <field name="x_trainer_id" domain="[('category_id','=',category_id[0][2])]" /> The field category_id has to be defined in that view, too. But if you

how can I use a email template in the following function?

元气小坏坏 提交于 2019-12-14 02:05:18
问题 I am trying to send mail function using the following code: def button_confirm_mom(self,cr,uid,ids,context=None): sobj = self.browse(cr, uid, ids) msg_pool = self.pool.get('mail.mail') cc_text = '' msg_vals = { 'subject' : "MoM has been created", 'email_from' : "abc@gmail.com", 'reply_to' : False, 'state' : 'outgoing', 'model' : False, 'res_id' : False, 'auto_delete' : False, } if sobj.matp: for cc_obj in sobj.matp: if cc_obj.empname.work_email: cc_text += cc_obj.empname.work_email + ',' if

Auto fill some fields in form when you found id of other form, odoo 8.0

你。 提交于 2019-12-14 00:26:57
问题 I try to create a simple function who try to fill specific fields in own form when I select the ID of patient registered in other form/module. I put an example: Module Registro: (create patient) (automatic generation ID and visible) -Nombre: -Email: -Teléfono: (save) Admisión module: (Open new form) -ID: select id (function for auto fill the next fields) -Nombre: nombre (registro) -Email: email(registro) -Teléfono: teléfono(registro) Use the new API Odoo 8.0 I try this, but doesn't work with

How to access one2many fields values on Kanban view odoo 0.8?

浪尽此生 提交于 2019-12-13 22:47:19
问题 I need to loop over the records of o2m filed in kanban to show what I need from the other model. all i need in kanban view to do this <t t-foreach="o2m_field" t-as"record"> <t t-esc="record.name"/> </t> Is that possible to do it? 回答1: Yes you can. This question is a duplicate to Is it possible to show an One2many field in a kanban view in Odoo? but here is a link to a module from Serpent Consulting which will be able to do what you are looking for. https://apps.openerp.com/apps/modules/8.0

How to include view in Odoo 8

纵饮孤独 提交于 2019-12-13 17:53:14
问题 As in the title. How do you include a view file from a view file? If you have a large xml view file with thousand lines would it be great if you can split them into partial view then include them in the main view. I have experimented with t t-call but it doesn't work <notebook> <page string="Page 1"> <t t-call="module.page_1"/> </page> <page string="Page 2"> <t t-call="module.page_2"/> </page> </notebook> 回答1: t-call Attribute : Which is works only in Qweb template but we can not call with

NotImplementedError: 'update' not supported on frozendict - Odoo v8

ⅰ亾dé卋堺 提交于 2019-12-13 15:29:58
问题 I have this code on my Odoo v8 module: @api.multi def button_generate_wh_doc(self): context = self._context partner = self.env['res.partner'] res = {} for inv in self: view_id = self.env['ir.ui.view'].search([ ('name', '=', 'account.invoice.wh.iva.customer')]) context.update({ 'invoice_id': inv.id, 'type': inv.type, 'default_partner_id': partner._find_accounting_partner( inv.partner_id).id, 'default_name': inv.name or inv.number, 'view_id': view_id, }) res = { 'name': _('Withholding vat

How to Change selection field automatically in odoo

房东的猫 提交于 2019-12-13 06:09:46
问题 I'm working on Odoo 8. I have a view that contains a set of combo-box type fields and a selection field. I want to make a test on the combo-box fields and if there are all checked then the selection field value should change. Here is what i have so far: def get_etat_dossier(self,cr,uid,ids,args,fields,context=None): res = {} for rec in self.browse(cr,uid,ids): if rec.casier_judiciare==True: # test field if = true res[rec.id]= 02 # field etat_dos type selection = Dossier Complet else: res[rec

Error when sending email through code in Odoo

浪尽此生 提交于 2019-12-13 05:25:12
问题 I created a function to send email by clicking a button "send email" in module "linh_warehoues" and I have this error: relation "mail_thread" does not exist I really don't understand what it means. I also checked and the class "mail_thread" exists in "mail_thread.py". Hope everyone can help me. Thank you in advance for your help and advice. Here is my code: ____openerp__.py { 'name': ' New Warehouse ', 'version': '1.0', 'category': 'Tools', 'description': 'Simulation of warehouse module',

Disable one2many popup odoo 8

梦想与她 提交于 2019-12-13 01:13:55
问题 Good Day! is it possible to disable pop of tree view in the form. I tried no_open="True" readonly="1" edit="False" both on field and tree view but didn't worked. <field name="payment_line"> <tree editable="top" create="false"> <field name="product"/> <field name="description"/> <field name="account"/> <field name="unit"/> <field name="qty"/> <field name="amount"/> <field name="total"/> </tree> </field> 回答1: I've coped with the same issue in odoo 10, my one2many treeview always make a popup on

How to achieve “Send by email” functionality in “Quotations” and “Sales Order” module in ODOO?

蹲街弑〆低调 提交于 2019-12-12 16:26:59
问题 I am developing ODOO application in iOS. I want to achieve "Send by email" functionality in "Quotations" and "Sales Order" module in ODOO. So is there any API available to achieve this functionality ? Or shall i generate PDF programmatically in iOS and send this by using MFMailComposeViewController class ? Thanks 回答1: It is best to reuse the Odoo feature. The button calls a method of the Sale Order model. You can identify the method's name if you activate the Developer Mode: The method is