Show and hide Cost Price List per warehouse based on condition If res.config.settings is_cost_price_per_warehouse = TRUE AND product.template -> product.category property_cost_method = [average] product.template (and/or product.product) standard_price is HIDDEN Show “Cost Price List” hyperlink Else Do like existing
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
1
ตอบกลับ
4256
มุมมอง
Show hide Button based on condition You can use my code
Python Codeis_visible_button_technical_acceptable = fields.Boolean(compute='_is_visible_button_technical_acceptable')def _is_visible_button_technical_acceptable(self):
# make your logic here
start_states = ['assignment_by_line_manager', 'engineer_review', 'line_manager_review', 'hod_review']
# start_states = ['draft', 'sent', 'cancel']
if self:
for rec in self:
if rec.rfq_type == 'foreign_case_tt_lc' and rec.foreign_case_tt_lc_state in start_states or rec.rfq_type == 'foreign_case_open_account' and rec.foreign_case_open_account_state in start_states or rec.rfq_type == 'spot_purchase_local_case' and rec.spot_purchase_local_case_state in start_states or rec.rfq_type == 'local_advanced_case' and rec.local_advanced_case_state in start_states or rec.rfq_type == 'confirmatory_case' and rec.confirmatory_case_state in start_states:
if rec.env.user.id == rec.purchase_representative.id or rec.env.user.id == rec.end_user.id or rec.env.user.id == rec.line_manager.id:
rec.is_visible_button_technical_acceptable = True
else:
rec.is_visible_button_technical_acceptable = False
else: rec.is_visible_button_technical_acceptable = Falsedef technically_acceptable(self):
# method call from button
if self:
for record in self:
for rec in record.order_line:
if rec.price_unit > 0 and not rec.regret:
rec.recommendation_status = 'technically_acceptable'
XML Code
name="is_visible_button_technical_acceptable" invisible="1"
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
พ.ย. 16
|
5811 | ||
|
4
พ.ย. 24
|
13443 | ||
|
1
ส.ค. 20
|
5334 | ||
|
2
ก.ย. 19
|
18664 | ||
|
0
เม.ย. 19
|
3181 |