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

Hey, our team has some problems adapting to the new standard for setting/checking customer for res.partner in odoo 14. It seems like the customer field is removed in version 14.


Previously we have used customer in domains in compute functions like this:

def _auto_init(self):
res = super(Partner, self)._auto_init()
records_without_inbox = self.search([("hemma_inbox_id", "=", None), ('customer', '=', True)])
record: Partner
for record in records_without_inbox:
inbox_id = self.env["hemma.inbox_connection"].sudo().create({"res_id": record.id, "res_model": self._name})
record.hemma_inbox_id = inbox_id
return res


And in records, such as this:


model="res.partner" id="partner_meh01">
name="name">Max Ehle
name="company_id" ref="base.main_company"/>
name="customer" eval="True"/>
name="email">max.ehle@ecsolutions.se
name="tz">Europe/Stockholm

How do we adopt our code and set / check customer in odoo 14?

อวตาร
ละทิ้ง
ผู้เขียน

Thanks! Can i use customer_rank in my fields aswell or its just for the domain?

yes you can use this field, instead of checking true or not previously, now check for whether the value is greater than 0

ผู้เขียน

like this? <field name="customer_rank" eval="0"/>

คำตอบที่ดีที่สุด

Hi,

In the newest version there is a field customer_rank, instead of customer = True domain, you can use following domain:

domain="[('customer_rank','>', 0)]"


Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 22
398
1
พ.ค. 22
3955
3
ก.ย. 21
5557
1
มี.ค. 21
5873
0
ม.ค. 21
3234