diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-10 14:34:55 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-10 14:34:55 +0700 |
| commit | 68c2e896a684e1dc68b4f01da38a444fe76bceac (patch) | |
| tree | b706fb7df382c718590ff346469fe11522333688 /indoteknik_custom/views | |
| parent | 2c0bb838b406503aa6a10cc0c21d474429246e18 (diff) | |
Add voucher model, view, and api
Diffstat (limited to 'indoteknik_custom/views')
| -rwxr-xr-x | indoteknik_custom/views/voucher.xml | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/indoteknik_custom/views/voucher.xml b/indoteknik_custom/views/voucher.xml new file mode 100755 index 00000000..32c15588 --- /dev/null +++ b/indoteknik_custom/views/voucher.xml @@ -0,0 +1,85 @@ +<odoo> + <data> + <record id="voucher_action" model="ir.actions.act_window"> + <field name="name">Voucher</field> + <field name="res_model">voucher</field> + <field name="view_mode">tree,form</field> + </record> + + <record id="voucher_tree" model="ir.ui.view"> + <field name="name">Voucher</field> + <field name="model">voucher</field> + <field name="arch" type="xml"> + <tree> + <field name="name"/> + <field name="code"/> + <field name="description"/> + </tree> + </field> + </record> + + <record id="voucher_form" model="ir.ui.view"> + <field name="name">Voucher</field> + <field name="model">voucher</field> + <field name="arch" type="xml"> + <form> + <sheet> + <group> + <group> + <field name="image" widget="image" width="120"/> + <field name="name" required="1" /> + <field name="description" placeholder="Insert short description..." /> + </group> + <group string="Rules"> + <field name="code" required="1" /> + <field name="visibility" required="1" /> + <field name="start_time" required="1"/> + <field name="end_time" required="1"/> + </group> + <group string="Discount Settings"> + <field name="min_purchase_amount" widget="monetary" required="1" /> + <field name="discount_type" required="1" /> + + <label for="max_discount_amount" string="Discount Amount" /> + <div class="d-flex align-items-center"> + <span + class="mr-1 font-weight-bold" + attrs="{'invisible': [('discount_type', '!=', 'fixed_price')]}" + > + Rp + </span> + <field class="mb-0" name="discount_amount" required="1" /> + <span + class="ml-1 font-weight-bold" + attrs="{'invisible': [('discount_type', '!=', 'percentage')]}" + > + % + </span> + </div> + + <field name="max_discount_amount" widget="monetary" required="1" attrs="{'invisible': [('discount_type', '!=', 'percentage')]}"/> + </group> + </group> + <notebook> + <page name="order_page" string="Orders"> + <field name="order_ids" readonly="1"> + <tree> + <field name="name" /> + <field name="amount_total" /> + </tree> + </field> + </page> + </notebook> + </sheet> + </form> + </field> + </record> + + <menuitem id="voucher" + name="Voucher" + parent="website_sale.menu_catalog" + sequence="1" + action="voucher_action" + /> + </data> +</odoo>
\ No newline at end of file |
