Skip to content

Commit

Permalink
FIX my commit revno 9 on the wizard to create the rental service
Browse files Browse the repository at this point in the history
Add a link to the screencast in the module description
  • Loading branch information
Alexis de Lattre committed Nov 26, 2014
1 parent ded5be1 commit 3d14216
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
4 changes: 3 additions & 1 deletion sale_rental/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@
* Properties on lines
A screencast that explains how to install, configure and use this module is available on Akretion's Youtube channel: https://www.youtube.com/watch?v=9o0QrGryBn8
Known limitations of the current implementation:
* the unit of measure of the rental services must be *Day* (we don't support the rental per hours / per week / per month...)
* when you sell a rental service, you must have as many sale order lines as rented equipements i.e. you can't rent multiple units of an equipment in one sale order line (it is possible to develop that, but it requires additionnal work).
Please contact Alexis de Lattre from Akretion <[email protected]> for any help or question about this module.
This module has been developped by Alexis de Lattre from Akretion <[email protected]>.
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
Expand Down
20 changes: 8 additions & 12 deletions sale_rental/wizard/create_rental_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class create_rental_product(orm.TransientModel):
digits_compute=dp.get_precision('Product Price')),
# I would like to translate the field 'name_prefix', but
# it doesn't seem to work in a wizard
'name_prefix': fields.char(
'Product Name Prefix', size=64, required=True),
'default_code_prefix': fields.char(
'Prefix for Default Code', size=16, required=True),
'name': fields.char(
'Product Name', size=64, required=True),
'default_code': fields.char(
'Default Code', size=16, required=True),
'categ_id': fields.many2one(
'product.category', 'Product Category', required=True),
}
Expand All @@ -56,8 +56,8 @@ def default_get(self, cr, uid, fields_list, context=None):
cr, uid, context['active_id'], context=context)
res.update({
'sale_price_per_day': 1.0,
'default_code_prefix': _('RENT-%s') % hw_product.default_code,
'name_prefix': _('Rental of one %s') % hw_product.name,
'default_code': _('RENT-%s') % hw_product.default_code,
'name': _('Rental of one %s') % hw_product.name,
})
return res

Expand All @@ -82,12 +82,8 @@ def create_rental_product(self, cr, uid, ids, context=None):
'uom_id': day_uom_id,
'uom_po_id': day_uom_id,
'list_price': wiz.sale_price_per_day,
'name': '%s%s' % (
wiz.name_prefix and wiz.name_prefix + ' ' or '',
hw_product.name),
'default_code': '%s%s' % (
wiz.default_code_prefix or '',
hw_product.default_code),
'name': wiz.name,
'default_code': wiz.default_code,
'rented_product_id': hw_product_id,
'must_have_dates': True,
'categ_id': wiz.categ_id.id,
Expand Down
7 changes: 4 additions & 3 deletions sale_rental/wizard/create_rental_product_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
<field name="arch" type="xml">
<form string="Create Rental Service" version="7.0">
<group>
<field name="name_prefix"/>
<field name="default_code_prefix"/>
<field name="name"/>
<field name="default_code"/>
<field name="categ_id"/>
<field name="sale_price_per_day"/>
</group>
<footer>
<button name="create_rental_product" string="Create" type="object" class="oe_highlight"/>
<button name="create_rental_product" string="Create"
type="object" class="oe_highlight"/>
<button special="cancel" string="Cancel" class="oe_link"/>
</footer>
</form>
Expand Down

0 comments on commit 3d14216

Please sign in to comment.