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

Hello,

I am trying to create a method in order to iterate multiple sales that were selected by user on List View. The action should appear on the actions dropdown and trigger mt python function. With the following code, I can create a confirmation modal and then execute the function on confirm.

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="view_sale_confirm_multiple_sales" model="ir.ui.view">
<field name="name">Confirmar Pedidos</field>
<field name="model">sale.confirm.multiple.sales</field>
<field name="arch" type="xml">
<form string="Confirmar Pedidos">
<p>
Tem certeza de que dejesa confirmar os pedidos selecionados?
</p>
<footer>
<button
name="confirm_sales"
string="Confirmar"
type="object"
class="btn-primary"
/>
<button string="Cancelar" class="btn-default" special="cancel"/>
</footer>
</form>
</field>
</record>

<record id="action_view_sale_confirm_multiple_sales" model="ir.actions.act_window">
<field name="name">Confirmar Pedidos</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.confirm.multiple.sales</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="groups_id" eval="[(5,ref('sales_team.group_sale_salesman'))]"/>
<!-- TODO: check if we need this -->
<field name="binding_model_id" ref="sale.model_sale_order" />
</record>
</odoo>

However, how can I simply call the "confirm_sales" method (the one on the modal's confirm button) straight, instead of popping the modal first?

Аватар
Отменить
Лучший ответ

Hi,

Can try the solution specified in the following answer: https://www.odoo.com/forum/help-1/question/how-can-i-add-an-option-into-action-dropdown-in-sale-order-odoo-10-143951#answer-143952


Thanks

Аватар
Отменить
Автор Лучший ответ

The code I posted is working just fine, my question is only how should I change it in order to call the python method (that is currently called on the confirmation button) when I click the action option on the actions dropdown instead of popping the modal first

Аватар
Отменить
Лучший ответ

Hi,

Not sure that what exactly you are looking for. If there is any issue in the above code on trying to confirm multiple sales/quotation at a time, you can check this module available in the odoo store for free:  https://apps.odoo.com/apps/modules/11.0/sale_order_mass_confirm/

Thanks

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
февр. 19
7343
1
авг. 25
209
1
авг. 25
133
0
авг. 25
135
3
авг. 25
1361