[IMP] (website_)event_booth(_sale): polish ux design
PURPOSE This commit is a first polish for event booth modules. It includes: - wording - add currency on price fields - removing booths tab on event view LINKS Task-2635461 PR: odoo/odoo#77081
This commit is contained in:
@@ -18,6 +18,7 @@ class EventBoothCategory(models.Model):
|
||||
'product.product', string='Product', required=True,
|
||||
domain=[('detailed_type', '=', 'event_booth')], default=_default_product_id)
|
||||
price = fields.Float(string='Price', compute='_compute_price', digits='Product Price', readonly=False, store=True)
|
||||
currency_id = fields.Many2one(related='product_id.currency_id')
|
||||
price_reduce = fields.Float(
|
||||
string='Price Reduce', compute='_compute_price_reduce',
|
||||
compute_sudo=True, digits='Product Price')
|
||||
|
||||
@@ -9,6 +9,7 @@ class EventTypeBooth(models.Model):
|
||||
|
||||
product_id = fields.Many2one(related='booth_category_id.product_id')
|
||||
price = fields.Float(related='booth_category_id.price')
|
||||
currency_id = fields.Many2one(related='booth_category_id.currency_id')
|
||||
|
||||
@api.model
|
||||
def _get_event_booth_fields_whitelist(self):
|
||||
|
||||
@@ -82,14 +82,13 @@ class TestEventData(TestEventBoothSaleCommon):
|
||||
]})
|
||||
|
||||
# change event type to one using booths: include event type booths and keep reserved booths
|
||||
event_form = Form(event)
|
||||
event_form.event_type_id = event_type_wbooths
|
||||
self.assertEqual(event_form.event_booth_count, 3)
|
||||
with Form(event) as event_form:
|
||||
event_form.event_type_id = event_type_wbooths
|
||||
self.assertEqual(event.event_booth_count, 3)
|
||||
self.assertEqual(
|
||||
set(r['name'] for r in event_form.event_booth_ids._records),
|
||||
set(r['name'] for r in event.event_booth_ids),
|
||||
set(('Custom Standard Booth 2', 'Standard Booth', 'Premium Booth')),
|
||||
'Should keep booths with reservation, remove unused ones and add type ones'
|
||||
)
|
||||
event_form.save()
|
||||
self.assertEqual(event.event_booth_count_available, 2)
|
||||
self.assertEqual(event.event_booth_category_ids, self.event_booth_category_1 + self.event_booth_category_2)
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<group name="main" position="inside">
|
||||
<group string="Booth Details">
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="product_id" context="{'default_detailed_type': 'event_booth', 'default_type': 'service'}"/>
|
||||
<field name="price"/>
|
||||
<field name="price" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
@@ -23,8 +24,9 @@
|
||||
<field name="priority">3</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="product_id"/>
|
||||
<field name="price"/>
|
||||
<field name="price" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -18,8 +18,10 @@
|
||||
<widget name="web_ribbon" title="Paid" attrs="{'invisible': [('is_paid', '=', False)]}"/>
|
||||
</div>
|
||||
<field name="booth_category_id" position="after">
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="product_id" attrs="{'invisible': [('booth_category_id', '=', False)]}"/>
|
||||
<field name="price" attrs="{'invisible': [('booth_category_id', '=', False)]}"/>
|
||||
<field name="price" widget="monetary" options="{'currency_field': 'currency_id'}"
|
||||
attrs="{'invisible': [('booth_category_id', '=', False)]}"/>
|
||||
</field>
|
||||
<group name="renter" position="after">
|
||||
<group name="sales" groups="base.group_no_one"
|
||||
@@ -44,7 +46,8 @@
|
||||
<field name="inherit_id" ref="event_booth.event_booth_view_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="booth_category_id" position="after">
|
||||
<field name="price"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="price" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
<field name="inherit_id" ref="event_booth.event_type_booth_view_form_from_type"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="booth_category_id" position="after">
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="product_id"/>
|
||||
<field name="price"/>
|
||||
<field name="price" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
@@ -19,8 +20,9 @@
|
||||
<field name="inherit_id" ref="event_booth.event_type_booth_view_tree_from_type"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="booth_category_id" position="after">
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="product_id"/>
|
||||
<field name="price"/>
|
||||
<field name="price" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</record>
|
||||
|
||||
<record id="event_booth_configurator_action" model="ir.actions.act_window">
|
||||
<field name="name">Configure an event booth</field>
|
||||
<field name="name">Select an event booth</field>
|
||||
<field name="res_model">event.booth.configurator</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
|
||||
Reference in New Issue
Block a user