| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 3 |
|
| 4 |
from odoo import api, fields, models |
| 5 |
|
| 6 |
|
| 7 |
class ResConfigSettings(models.TransientModel): |
| 8 |
_inherit = 'res.config.settings' |
| 9 |
|
| 10 |
group_expiry_date_on_delivery_slip = fields.Boolean("Display Expiration Dates on Delivery Slips", |
| 11 |
implied_group='product_expiry.group_expiry_date_on_delivery_slip') |
| 12 |
|
| 13 |
@api.onchange('group_lot_on_delivery_slip') |
| 14 |
def _onchange_group_lot_on_delivery_slip(self): |
| 15 |
if not self.group_lot_on_delivery_slip: |
| 16 |
self.group_expiry_date_on_delivery_slip = False |
| 17 |
|
| 18 |
@api.onchange('group_stock_production_lot') |
| 19 |
def _onchange_group_stock_production_lot(self): |
| 20 |
super()._onchange_group_stock_production_lot() |
| 21 |
if self.group_stock_production_lot: |
| 22 |
self.module_product_expiry = True |
| 23 |
|
| 24 |
@api.onchange('module_product_expiry') |
| 25 |
def _onchange_module_product_expiry(self): |
| 26 |
if not self.module_product_expiry: |
| 27 |
self.group_expiry_date_on_delivery_slip = False |