تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4801 أدوات العرض

 I want to overrule the state of a sale_order report upon printing. Meaning i can have 2 buttons for printing. 1 for the sale order and 1 for the quotation. 

I tried to call the sale.report_saleorder_document with an additional parameter but this doesn't work

This is my call to render the report:

  <template id="report_sale_order_quotation">
	<t t-call="web.html_container">
		<t t-foreach="docs" t-as="doc">
			<t t-set="state" t-value="['draft']"/>
			<t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
		</t>
	</t>
</template>

AI also tried to set the doc.state like this :

<template id="report_sale_order_quotation">
	<t t-call="web.html_container">
		<t t-foreach="docs" t-as="doc">
			<t t-set="doc.state" t-value="['draft']"/>
			<t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
		</t>
	</t>
</template>

Is it possible to set the state of the order for printing indepent of the order state in the database? I hope anyone knows a workable solution.


الصورة الرمزية
إهمال
أفضل إجابة

Hello Jordy,

You can try below code and replace it with your one.

<t t-set="custom_state" t-value="draft"/>

You can now use custom_state in your report xml file.

Hope it will help.





Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari



الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
نوفمبر 19
4172
1
مارس 24
1336
0
أغسطس 23
1743
4
أكتوبر 20
10143
9
يناير 20
8000