_inherit ='res.partner'
kota_id = fields.Many2one(comodel_name='aris_kota.kota', string='Kota / Kab.', domain="[('state_id', '=', state_id)]")
@api.onchange('kota_id')
def_onchange_kota_id(self):
if self.kota_id:
self.city =self.kota_id.name
kecamatan_id = fields.Many2one(comodel_name='aris_kota.kecamatan',string='Kecamatan', domain="[('kota_id', '=', kota_id)]")
@api.model
def_address_fields(self):
"""Returns the list of address fields that are synced from the parent."""
return list(ADDRESS_FIELDS)
@api.model
def_formatting_address_fields(self):
"""Returns the list of address fields usable to format addresses."""return self._address_fields()
class PaymentTransaction(models.Model):
_inherit ='payment.transaction'
@api.model_create_multi
def create(self, values_list):
class Partner(models.Model):
kecamatancoba = self._getkecamatan() # i get the error here, the message is => "We are not able to process your payment. 'payment.transaction' object has no attribute '_getkecamatan' "
How To get and use kecamatan_id.name value in class PaymentTransaction from class partner ?
Hi, inside your PaymentTransaction class you haven't defined a _getkecamatan method yet. Perhaps what you mean is "How to get and use kecamatan_id,name value from class Partner to class PaymentTransaction?