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