This question has been flagged

I want to configure alerts in the supercalendar for the warranty ending date.Warranty is the module which I have created for my purpose.The module have the model warranty.warranty,with options to select Customer Name,Warranty Start Date and Warranty End Date,Warranty Period,Details of warranty product,Serial No.,Batch No. etc.I have configured in Configurators using following data. Model : warranty.warranty . Description Type : Field. Description Field : Serial No. Description : Warranty Expiration . Start date field : Warranty To (Warranty End Date).

Now the issue is when the warranty end dates are configured in the super Calendar they are listed on the basis of Serial No. only instead I want them to be alerted on the basis of the respective Customer Name.The Description Field combo in which Serial No . have been selected have only 3 items in the menu Serial No,Batch No and Warranty Period.What is the solution for this issue so that I can get the Customer name instead of Serial no/batch no.?

Avatar
Discard

Could you post the part of your code where the fields are defined ?

Author

i didnt get you?which portion of the code do i need to post?

Where the FIELDS are defined: "Customer Name,Warranty Start Date and Warranty End Date,Warranty Period,Details of warranty product,Serial No.,Batch No. "

Author

ok.Some are defined as base fields and the rest as Custom fields.

Author

Customer Name,Serial No.,Batch No are defined as base field in class warranty.warranty and the others are defined as custom fields.

Author

class warranty_warranty(osv.osv):

_name = 'warranty.warranty'

_columns = {
    'name':fields.many2one('res.partner','Customer Name'),
    'contract':fields.many2one('account.analytic.account','Contract'),
    'batch_no':fields.char('Batch No.'),
    'status':fields.selection([('open','Open'),('close','Close')],'Warranty Status'),
    'serial_no':fields.char('Serial No.'),
    'notes':fields.text('Details'),
    'line_ids': fields.one2many('order.line','ordr_id',"PREVENTIVE MAINTENANCE"),

 }

    warranty_warranty()
Best Answer

OK, you can hide your code

SupCal DescField

  "name_id"': fields.many2one('res.partner.name', 'Customer Name'),

Don't forget to add:

   _inherit = 'res.partner'

You can also add:

   domain="[('customer','=',True)]"

to get only the Customers Partners

Code posted by Sneha (modified)

 class warranty_warranty(osv.Model):

      _name = 'warranty.warranty'

      _inherit = 'res.partner'

_columns = {
     "name_id"': fields.many2one('res.partner.name', 'Customer Name', domain="[('customer','=',True)]" ),

     'contract':fields.many2one('account.analytic.account','Contract'),

     'batch_no':fields.char('Batch No.'),

     'status':fields.selection([('open','Open'),('close','Close')],'Warranty Status'),

     'serial_no':fields.char('Serial No.'),

     'notes':fields.text('Details'),

     'line_ids': fields.one2many('order.line','ordr_id',"PREVENTIVE MAINTENANCE"),


  }

     warranty_warranty()

Test this code, and let me know if it works.

Avatar
Discard
Author

Can you be a bit descriptive?I am not clear with the changes to be made

Author

I tried using the above code.then restarted the sever.But still the warranty alerts are configured on the basis of serial number

Author

Is there any any solution?I think the drop down of the description field is showing all the fields with 'char' field type.What if I change the code like this? 'description_field_id':fields.many2one('ir.model.fields','Description Field',domain="[('model_id','=',name),('ttype','=','char')]"),

Best Answer

The app https://apps.odoo.com/apps/modules/9.0/joint_calendar/ let you make any sort of alarms including notifications and emails

Avatar
Discard