예제 #1
0
 def _compute_reference(self):
     if self.default_code:
         reference = self.default_code
     else:
         reference = 'F' + base_conversion.baseN(self.id, 36,
                                      'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
                                      4)
     return reference
예제 #2
0
 def _compute_reference(self):
     if self.ref:
         reference = self.ref
     else:
         reference = base_conversion.baseN(self.id, 36,
                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
                                     4)
         if self.company_id == self.env.ref('base.main_company'):
             reference = 'P' + reference
         elif self.company_id == self.env.ref('__export__.res_company_6'):
             reference = 'ML' + reference
         elif self.company_id == self.env.ref('__export__.res_company_7'):
             reference = 'MR' + reference
         elif self.company_id == self.env.ref('__export__.res_company_5'):
             reference = 'S' + reference
         else:
             reference = '#' + reference
     return reference