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

I already make a paper format from xml. it's the same as A4 but with no margin


currently the default is still A4. But I want to set my paper format as the default in the setting. How can I achieve this?



อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello @dimas aditya


Hope you are doing well.


- The paper format is connected with the company, so you must modify the default value from the company. To achieve this, you must inherit "res.company" and change the default value of the paper format using the code below:

paperformat_id = fields.Many2one(default=lambda self: self.env.ref('your_module_name.proposal', raise_if_not_found=False))


Feel free to contact me if needed

Hope this will help you.

Thanks & Regards,
Email:  odoo@aktivsoftware.com         

Skype: kalpeshmaheshwari

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

I've made a new python model called res_company.py
class ResCompany(models.Model) :
_inherit ='res.company '
paperformat_id = fields . Many2One('report.paperformat' ,string: 'Paper format' ,default=lambda self: self.env.ref('my_module.proposal' ,raise_if_not_found=False))

Then I try to make new database, make sure the module is upgraded, make sure it's imported in models/__init__.py, install the module, , no error showing, and the paperformat is still not set to my custom paperformat

Related Posts ตอบกลับ มุมมอง กิจกรรม
[Odoo11] PaperFormat: A5 แก้ไขแล้ว
3
ก.พ. 22
8325
How to Add Custom Paper Format ? แก้ไขแล้ว
2
ต.ค. 23
6369
2
เม.ย. 15
5359
1
ก.ย. 23
7149
0
ก.ย. 23
1287