While we make quotations to customers, don't allow users to quote below the sales price of products. How can we achieve this? Please help me. Am using v7.. Thanks in advance
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
1
Balas
4683
Tampilan
Call the function for the field price_unit
in the view xml
<xpath expr="//field[@name='price_unit']" position="attributes">
<attribute name="on_change">check_margin(product_id,price_unit)</attribute>
</xpath>
and in the class, define the function to process it.
def check_margin(self, cr, uid, ids, product_id, unit_price, context=None):
res = {}
warning = {}
sale_price = None
if product_id:
sale_price = self.pool.get('product.product').browse(cr, uid,product_id).list_price
if unit_price is None:
pass
elif unit_price < sale_price:
warning = {
'title': _("Warning"),
'message': _('Unit price given, is less than the sales price of the selected product. Please change (or contact your sales manager to change) the sales price of the selected product.'),
}
res = {'value': {'price_unit':sale_price}}
elif unit_price >= sale_price:
res = {'value': {'price_unit':unit_price}}
pass
return {'value': res.get('value'), 'warning':warning}
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
0
Jun 25
|
417 | ||
|
1
Jul 18
|
5645 | ||
|
0
Jul 25
|
5227 | ||
|
1
Jul 24
|
2163 | ||
|
1
Feb 19
|
3860 |