04.03.26
This commit is contained in:
@@ -2300,21 +2300,24 @@ class SaleReport(CompanyReport):
|
||||
|
||||
@classmethod
|
||||
def execute(cls, ids, data):
|
||||
pool = Pool()
|
||||
Company = pool.get('company.company')
|
||||
with Transaction().set_context(address_with_party=True):
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def _execute(cls, records, header, data, action):
|
||||
company_id = Transaction().context.get('company')
|
||||
logger.info("_EXECUTE:%s",company_id)
|
||||
if company_id:
|
||||
pool = Pool()
|
||||
Company = pool.get('company.company')
|
||||
company = Company(company_id)
|
||||
if company.party.name == 'MELYA':
|
||||
data = dict(data)
|
||||
data['action_id'] = None
|
||||
# Patch l'objet action en mémoire, pas en DB
|
||||
action.report = 'sale/sale_melya.fodt'
|
||||
action.report_content = None # force rechargement depuis fichier
|
||||
|
||||
with Transaction().set_context(
|
||||
address_with_party=True,
|
||||
report_company=company_id):
|
||||
return super().execute(ids, data)
|
||||
|
||||
return super()._execute(records, header, data, action)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, header, data):
|
||||
pool = Pool()
|
||||
@@ -2326,21 +2329,6 @@ class SaleReport(CompanyReport):
|
||||
context['today'] = Date.today()
|
||||
return context
|
||||
|
||||
@classmethod
|
||||
def _get_action(cls, data):
|
||||
action = super()._get_action(data)
|
||||
|
||||
Company = Pool().get('company.company')
|
||||
company_id = Transaction().context.get('company')
|
||||
logger.info("GET_ACTION:%s",company_id)
|
||||
if company_id:
|
||||
company = Company(company_id)
|
||||
logger.info("GET_ACTION_NAME:%s",company.party.name)
|
||||
if company.party.name == 'MELYA':
|
||||
action.report = 'sale/sale_melya.fodt'
|
||||
|
||||
return action
|
||||
|
||||
class OpenCustomer(Wizard):
|
||||
'Open Customers'
|
||||
__name__ = 'sale.open_customer'
|
||||
|
||||
Reference in New Issue
Block a user