Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'search' #8

Open
PavanKumar8909 opened this issue Jul 28, 2017 · 0 comments
Open

Comments

@PavanKumar8909
Copy link

PavanKumar8909 commented Jul 28, 2017

hi,
i am creating one model like tax_category and another model is tax_sub i want know to do notebook in openerp6
my problem is i am getting this error"AttributeError: 'NoneType' object has no attribute 'search'"

class ci_tax_category(osv.osv):
_name = 'ci.tax.category'
_columns = {
'name' : fields.char('Tax Category',size=100),
'active':fields.boolean('Active'),
'tax_gst_category_id':fields.one2many('ci.tax_gst','ci_tax_gst_id','Tax1 Id'),
}
_sql_constraints = [('name_uniq', 'unique(name)', 'Tax Category must be unique !'),
]
_defaults = {'active':True}

def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
name = self.read(cr, uid, [id], ['name'], context)[0]['name']
default.update({'name': name+ _(' (copy)'), 'events':[]})
return super(ci_tax_category, self).copy(cr, uid, id, default, context)

ci_tax_category()

class ci_tax_gst(osv.osv):
_name='ci.tax_gst'
_columns={
'name':fields.char('GST Tax',required=True),
'active':fields.boolean('Active'),
'stat_amt':fields.float('Start Amount'),
'end_amt':fields.float('End Amount'),

                'cgst_per':fields.float('CGST'),
                'sgst_per':fields.float('SGST'),
                'igst_per':fields.float('IGST'),
                'ci_tax_gst_id':fields.many2one('ci.tax_category','Tax1 Id',required=True),
           }
  _sql_constraints = [
 ('Tax', 'unique (name,ci_tax_category)', 'The Tax name already exists for this Tax Category!'),

]
_defaults={'active':True}

  def copy(self, cr, uid, id, default=None, context=None):
    if default is None:
        default = {}
    name = self.read(cr, uid, [id], ['name'], context)[0]['name']
    default.update({'name': name+ _(' (copy)'), 'events':[]})
    return super(ci_tax_gst, self).copy(cr, uid, id, default, context)

ci_tax_gst()

in xml i put notebook code inside the ci.tax_category form view














Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant