Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
900 Представления

want to fetch mulitple company quotation,sale order,invoice for portal user its fetch one company data


def _get_invoices_domain(self):
return [
('move_type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt')),
('company_id', 'in', [1,2,3,4]) # Assuming there's a company_id field in your invoice model
]
Аватар
Отменить
Автор

its fetch only via selection website.company_id many2one field when i select in website company_id its fetch that according data fetch not our condition wise.

its fetch at a time one company invoice how to resolved or override this condition i try your code but its still fetch only company data fetch who are selected on website setting company_id

please help

Лучший ответ

Hi,

Try this code :
def _get_documents_domain(self, document_type='invoice'):
    document_types = {
        'invoice': ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'),
        'sale_order': ('sale', 'refund'),
        'quotation': ('sale_quotation', 'purchase_quotation'),
    }

    return [
        ('move_type', 'in', document_types[document_type]),
        ('company_id', 'in', [1, 2, 3, 4]) ]


Hope it helps

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
июн. 23
1309
3
дек. 24
2786
1
мар. 24
2323
2
дек. 23
2837
1
окт. 23
2495