Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
4437 มุมมอง

Hi there,

Working on a module that adds the tickbox to the partner (this bit works fine). However, when I try to copy this into account.invoice got the error.
Code:

res_partner.py
# -*- coding: utf-8 -*-

from openerp import models, fields, api, _

class ResPartnerTickbox(models.Model):
    _inherit = "res.partner"

    company_tickbox = fields.Boolean(string='Email invs/statements', help='Select this box if the customer wants to receive invoices and statements by email.', store='true', default="true")
    company_tickbox1 = fields.Boolean(string='Email invs/statements', help='Select this box if the customer wants to receive invoices and statements by email.', store='true', default="true")

    @api.model
    def _commercial_fields(self):
        
        commercial_fields = super(ResPartnerTickbox, self)._commercial_fields()
        new_commercial_fields = ['company_tickbox', 'company_tickbox1']
        commercial_fields.extend(new_commercial_fields)
        return commercial_fields

invoice.py
# -*- coding: utf-8 -*-
from openerp import api, fields, models, _
class Tickbox_Invoice(models.Model):
    _inherit = 'account.invoice'
    
    company_tickbox = fields.Boolean(related='partner_id.company_tickbox', store=True)


อวตาร
ละทิ้ง

Hi,

please add the error logs and, preferably, the code of the res.partner

ผู้เขียน คำตอบที่ดีที่สุด

  File "/usr/lib/python2.7/dist-packages/openerp/addons/bus/controllers/main.py", line 34, in poll

    raise Exception("bus.Bus unavailable")


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 16
3204
1
ก.ค. 23
4339
0
ก.ค. 18
2524
2
ม.ค. 17
3307
Account Invoice model inheritance แก้ไขแล้ว
1
ม.ค. 16
6758