Change field contact sale

This commit is contained in:
cosmos 2022-10-27 15:28:42 -05:00
parent b64c897618
commit 4f18a39a96
2 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import datetime
from collections import defaultdict
from trytond.pool import Pool
from trytond.model import (

View File

@ -44,6 +44,10 @@ class Sale(metaclass=PoolMeta):
'invisible': (Eval('sale_type') != 'maintenance'),
'readonly': True})
@classmethod
def __setup__(cls):
super(Sale, cls).__setup__()
cls.contact.states['required']=True
@fields.depends('lines', 'sale_type', 'agended')
def on_chage_sale_type(self):