n00biex141
(Reeyan Afzal)
August 29, 2023, 4:14am
1
Recently, I started working on a button (Wizard) that will help me add POS Sale Line on the fly instead of going to that + button. I made a custom button called Add Lines
Now, the problem I am facing is with the layout and size of that thing. Here:
Whereas I want something like this:
Here’s the XML Code:
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<label name="product"/>
<field name="product"/>
<!-- <group id="quantity" colspan="2" col="4">-->
<label name="quantity"/>
<field name="quantity" symbol="unit"/>
<label name="available_quantity"/>
<field name="available_quantity" symbol="unit"/>
<!-- </group>-->
<field name="base_price" invisible="1"/>
<field name="storage_location" invisible="1" />
<notebook>
<page string="General" id="general">
<!-- <group id="discounts">-->
<!-- -->
<label name="discount_rate" xalign="0.0" xexpand="1"/>
<group id="discount_rate">
<field name="discount_rate" factor="100" xexpand="0" />
<label string="%" />
</group>
<label name="discount_amount"/>
<field name="discount_amount"/>
<!-- </group>-->
<label name="unit_price"/>
<field name="unit_price"/>
<label name="amount"/>
<field name="amount"/>
</page>
</notebook>
</form>
ced
(Cédric Krier)
August 29, 2023, 6:50am
2
The size of wizard dialog is always md
but since Change the dialog size depending of the content (#8086) · Issues · Tryton / Tryton · GitLab it is changed for lg
if it contains widget with expand
attribute.
n00biex141
(Reeyan Afzal)
August 29, 2023, 9:10am
3
Ah! for some reason as you can see in the second screenshot it appears to be fine. Can you please go through the XML code and tell me if it’s correct.
ced
(Cédric Krier)
August 29, 2023, 10:30am
4
It is because the sale_line_form.xml
contains the One2Many
fields moves
which has the expand
attribute.
1 Like
n00biex141
(Reeyan Afzal)
August 29, 2023, 11:04am
5
I’ve downloaded that sao/src/wizard.js patch you provided ( Issue 60531002: sao: Change the size of wizard dialog depending of the content - Code Review (tryton.org) )
My question is do I need to update/build sao again? If so, then how?
ced
(Cédric Krier)
August 29, 2023, 11:10am
6
It is included in sao since 4 years (and your screenshots show that it is there). I put the link to describe the behavior.
For now there is no way to force one or another size for the dialog, it only depends on what is inside.
n00biex141
(Reeyan Afzal)
August 30, 2023, 4:32am
7
Thank you so much! This issue has been resolved. However, there’s one tiny thing I need to do now.
As you can see in this image
The Amount is followed by the $ and then the field itself.
Here in my wizard I don’t have it
I want the experience as close as to the original itself. Please guide me about that part
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<label name="product"/>
<field name="product"/>
<group id="quantity" colspan="2" col="4">-->
<label name="quantity"/>
<field name="quantity" symbol="unit"/>
<label name="available_quantity"/>
<field name="available_quantity" symbol="unit"/>
</group>
<newline/>
<field name="base_price" invisible="1"/>
<field name="storage_location" invisible="1" />
<notebook>
<page string="General" id="general">
<label id="discount" string="Discount"/>
<group col="-1" id="discounts">
<group col="-1" id="discount_rate">
<field name="discount_rate" factor="100" xexpand="0"/>
<label name="discount_rate" string="%" xalign="0.0" xexpand="1"/>
</group>
<label name="discount_amount" string="$"/>
<field name="discount_amount"/>
</group>
<label name="unit_price"/>
<field name="unit_price"/>
<label name="amount"/>
<field name="amount"/>
</page>
<page string="Hidden" id="hidden_taxes" invisible="1">
<field name="invisible_field" expand="1" />
</page>
</notebook>
</form>
ced
(Cédric Krier)
August 30, 2023, 6:36am
8
This is because the Monetary
field is used with the currency
attribute set to the currency
field.
You can also use the symbol
attribute on the <field>
of the view.
1 Like
system
(system)
Closed
August 30, 2023, 6:36pm
9
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.