summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@tinyerp.com>2012-12-08 11:33:38 +0100
committerFabien Pinckaers <fp@tinyerp.com>2012-12-08 11:33:38 +0100
commitfae0f2e539e09bef903ffb952a22201940c042fb (patch)
treeead509b4d89797103c85c524b54d8e52078fc495
parenta2508290c27054328a220ac4e90bbd9915485a87 (diff)
parent374c717ec74730b257aaf922478f83ed645d7c01 (diff)
[MERGE] fix account asset, event, purchase
bzr revid: fp@tinyerp.com-20121208103338-5cm3knhiaijvgks4
-rw-r--r--addons/account/product_view.xml1
-rw-r--r--addons/account_asset/account_asset.py25
-rw-r--r--addons/account_asset/account_asset_view.xml4
-rw-r--r--addons/account_asset/wizard/account_asset_change_duration_view.xml11
-rw-r--r--addons/account_check_writing/account_voucher_view.xml2
-rw-r--r--addons/event_sale/event_sale.py2
-rw-r--r--addons/event_sale/event_sale_view.xml14
-rw-r--r--addons/hr/hr_view.xml6
-rw-r--r--addons/membership/membership_view.xml3
-rw-r--r--addons/mrp/mrp_view.xml4
-rw-r--r--addons/mrp_byproduct/mrp_byproduct.py1
-rw-r--r--addons/product/product.py2
-rw-r--r--addons/product/product_view.xml2
-rw-r--r--addons/purchase/report/request_quotation.rml3
-rw-r--r--addons/purchase_requisition/purchase_requisition_view.xml2
-rw-r--r--addons/sale/sale_view.xml2
16 files changed, 53 insertions, 31 deletions
diff --git a/addons/account/product_view.xml b/addons/account/product_view.xml
index a70fdf38f3c..44d53839700 100644
--- a/addons/account/product_view.xml
+++ b/addons/account/product_view.xml
@@ -4,6 +4,7 @@
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form.inherit</field>
<field name="model">product.product</field>
+ <field name="priority">5</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<notebook position="inside">
diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py
index a44226e76c8..3190801764b 100644
--- a/addons/account_asset/account_asset.py
+++ b/addons/account_asset/account_asset.py
@@ -41,8 +41,8 @@ class account_asset_category(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True),
'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, help="Choose the method to use to compute the amount of depreciation lines.\n"\
" * Linear: Calculated on basis of: Gross Value / Number of Depreciations\n" \
- " * Degressive: Calculated on basis of: Remaining Value * Degressive Factor"),
- 'method_number': fields.integer('Number of Depreciations'),
+ " * Degressive: Calculated on basis of: Residual Value * Degressive Factor"),
+ 'method_number': fields.integer('Number of Depreciations', help="The number of depreciations needed to depreciate your asset"),
'method_period': fields.integer('Period Length', help="State here the time between 2 depreciations, in months", required=True),
'method_progress_factor': fields.float('Degressive Factor'),
'method_time': fields.selection([('number','Number of Depreciations'),('end','Ending Date')], 'Time Method', required=True,
@@ -222,6 +222,15 @@ class account_asset_asset(osv.osv):
else:
val['currency_id'] = company.currency_id.id
return {'value': val}
+
+ def onchange_purchase_salvage_value(self, cr, uid, ids, purchase_value, salvage_value, context=None):
+ val = {}
+ for asset in self.browse(cr, uid, ids, context=context):
+ if purchase_value:
+ val['value_residual'] = purchase_value - salvage_value
+ if salvage_value:
+ val['value_residual'] = purchase_value - salvage_value
+ return {'value': val}
_columns = {
'account_move_line_ids': fields.one2many('account.move.line', 'asset_id', 'Entries', readonly=True, states={'draft':[('readonly',False)]}),
@@ -243,9 +252,9 @@ class account_asset_asset(osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]}),
'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose the method to use to compute the amount of depreciation lines.\n"\
" * Linear: Calculated on basis of: Gross Value / Number of Depreciations\n" \
- " * Degressive: Calculated on basis of: Remaining Value * Degressive Factor"),
- 'method_number': fields.integer('Number of Depreciations', readonly=True, states={'draft':[('readonly',False)]}, help="Calculates Depreciation within specified interval"),
- 'method_period': fields.integer('Number of Months in a Period', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="State here the time during 2 depreciations, in months"),
+ " * Degressive: Calculated on basis of: Residual Value * Degressive Factor"),
+ 'method_number': fields.integer('Number of Depreciations', readonly=True, states={'draft':[('readonly',False)]}, help="The number of depreciations needed to depreciate your asset"),
+ 'method_period': fields.integer('Number of Months in a Period', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="The amount of time between two depreciations, in months"),
'method_end': fields.date('Ending Date', readonly=True, states={'draft':[('readonly',False)]}),
'method_progress_factor': fields.float('Degressive Factor', readonly=True, states={'draft':[('readonly',False)]}),
'value_residual': fields.function(_amount_residual, method=True, digits_compute=dp.get_precision('Account'), string='Residual Value'),
@@ -359,8 +368,8 @@ class account_asset_depreciation_line(osv.osv):
'sequence': fields.integer('Sequence', required=True),
'asset_id': fields.many2one('account.asset.asset', 'Asset', required=True),
'parent_state': fields.related('asset_id', 'state', type='char', string='State of Asset'),
- 'amount': fields.float('Depreciation Amount', digits_compute=dp.get_precision('Account'), required=True),
- 'remaining_value': fields.float('Amount to Depreciate', digits_compute=dp.get_precision('Account'),required=True),
+ 'amount': fields.float('Current Depreciation', digits_compute=dp.get_precision('Account'), required=True),
+ 'remaining_value': fields.float('Next Period Depreciation', digits_compute=dp.get_precision('Account'),required=True),
'depreciated_value': fields.float('Amount Already Depreciated', required=True),
'depreciation_date': fields.date('Depreciation Date', select=1),
'move_id': fields.many2one('account.move', 'Depreciation Entry'),
@@ -460,7 +469,7 @@ class account_asset_history(osv.osv):
help="The method to use to compute the dates and number of depreciation lines.\n"\
"Number of Depreciations: Fix the number of depreciation lines and the time between 2 depreciations.\n" \
"Ending Date: Choose the time between 2 depreciations and the date the depreciations won't go beyond."),
- 'method_number': fields.integer('Number of Depreciations'),
+ 'method_number': fields.integer('Number of Depreciations', help="The number of depreciations needed to depreciate your asset"),
'method_period': fields.integer('Period Length', help="Time in month between two depreciations"),
'method_end': fields.date('Ending date'),
'note': fields.text('Note'),
diff --git a/addons/account_asset/account_asset_view.xml b/addons/account_asset/account_asset_view.xml
index 520ee733e73..c4cb17bded3 100644
--- a/addons/account_asset/account_asset_view.xml
+++ b/addons/account_asset/account_asset_view.xml
@@ -108,8 +108,8 @@
<page string="General">
<group>
<group>
- <field name="purchase_value" widget="monetary" options="{'currency_field': 'currency_id'}"/>
- <field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}"/>
+ <field name="purchase_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(purchase_value, salvage_value)"/>
+ <field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_purchase_salvage_value(purchase_value, salvage_value)"/>
<field name="value_residual" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="partner_id"/>
</group>
diff --git a/addons/account_asset/wizard/account_asset_change_duration_view.xml b/addons/account_asset/wizard/account_asset_change_duration_view.xml
index 1c7f3458441..bb848e6db5d 100644
--- a/addons/account_asset/wizard/account_asset_change_duration_view.xml
+++ b/addons/account_asset/wizard/account_asset_change_duration_view.xml
@@ -8,12 +8,17 @@
<field name="arch" type="xml">
<form string="Modify Asset" version="7.0">
<group string="Asset Durations to Modify" col="4">
- <field name="name" colspan="4"/>
<group colspan="2" col="2">
+ <field name="name"/>
<field name="method_number"/>
- <field name="method_end"/>
</group>
- <field name="method_period"/>
+ <group colspan="2" col="2">
+ <field name="method_end"/>
+ <label for="method_period"/>
+ <div>
+ <field name="method_period" class="oe_inline"/> months
+ </div>
+ </group>
</group>
<separator string="Notes"/>
<field name="note"/>
diff --git a/addons/account_check_writing/account_voucher_view.xml b/addons/account_check_writing/account_voucher_view.xml
index 520c78009d5..de7ecd327a9 100644
--- a/addons/account_check_writing/account_voucher_view.xml
+++ b/addons/account_check_writing/account_voucher_view.xml
@@ -9,7 +9,7 @@
<field name="model">account.voucher</field>
<field name="inherit_id" ref="account_voucher.view_vendor_payment_form" />
<field name="arch" type="xml">
- <field name="journal_id" position="after">
+ <field name="amount" position="after">
<newline/>
<field name="allow_check" invisible="1"/>
<field name="amount_in_word" attrs="{'invisible':[('allow_check','!=',1)]}" nolabel="1" colspan="6"/>
diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py
index f4d7fcaa013..4f77b945f69 100644
--- a/addons/event_sale/event_sale.py
+++ b/addons/event_sale/event_sale.py
@@ -26,7 +26,7 @@ class product(osv.osv):
_inherit = 'product.product'
_columns = {
'event_ok': fields.boolean('Event Subscription', help='Determine if a product needs to create automatically an event registration at the confirmation of a sale order line.'),
- 'event_type_id': fields.many2one('event.type', 'Type of Event', help='Filter the list of event on this category only, in the sale order lines'),
+ 'event_type_id': fields.many2one('event.type', 'Type of Event', help='Select event types so when we use this product in Sale order line, it will filter events of this type only.'),
}
def onchange_event_ok(self, cr, uid, ids, event_ok, context=None):
diff --git a/addons/event_sale/event_sale_view.xml b/addons/event_sale/event_sale_view.xml
index ab7568d704e..cc00365c980 100644
--- a/addons/event_sale/event_sale_view.xml
+++ b/addons/event_sale/event_sale_view.xml
@@ -10,9 +10,9 @@
<field name="event_ok" on_change="onchange_event_ok(event_ok, context)"/>
<label for="event_ok"/>
</div>
- <field name='default_code' position='before'>
+ <div name='ean' position="after">
<field name="event_type_id" attrs="{'readonly': [('event_ok', '=', False)]}"/>
- </field>
+ </div>
</field>
</record>
@@ -21,12 +21,18 @@
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
- <xpath expr="//field[@name='discount']" position="after">
- <field name="event_id" colspan="3" domain="[('type', 'in', list(set((event_type_id,False))))]" attrs="{'invisible': [('event_ok', '=', False)],'required': [('event_ok', '!=', False)]}"/>
+ <xpath expr="//field[@name='product_id']" position="after">
+ <field name="event_id" domain="['|', ('type','=', False),('type', '=', event_type_id)]" attrs="{'invisible': [('event_ok', '=', False)],'required': [('event_ok', '!=', False)]}"/>
<field name="event_type_id" invisible="1"/>
<field name="event_ok" invisible="1"/>
</xpath>
</field>
</record>
+
+ <!-- the presence of 'event user' makes the order lines non-editable -->
+ <record id="sale.view_order_form_editable_list" model="ir.ui.view">
+ <field name="groups_id" eval="[(4, ref('event.group_event_user'))]"/>
+ </record>
+
</data>
</openerp>
diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml
index 7d27fe456b8..dc65fa80e8b 100644
--- a/addons/hr/hr_view.xml
+++ b/addons/hr/hr_view.xml
@@ -25,8 +25,8 @@
<h1>
<field name="name"/>
</h1>
- <label for="category_ids" class="oe_edit_only"/>
- <field name="category_ids" widget="many2many_tags" placeholder="e.g. Part Time"/>
+ <label for="category_ids" class="oe_edit_only" groups="base.group_hr_user"/>
+ <field name="category_ids" widget="many2many_tags" placeholder="e.g. Part Time" groups="base.group_hr_user"/>
</div>
<div class="oe_right oe_button_box" name="button_box">
<!-- Put here related buttons -->
@@ -112,7 +112,7 @@
<search string="Employees">
<field name="name" string="Employees"/>
<field name="department_id" />
- <field name="category_ids"/>
+ <field name="category_ids" groups="base.group_hr_user"/>
<group expand="0" string="Group By...">
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'parent_id'}"/>
<filter string="Coach" icon="terp-personal" domain="[]" context="{'group_by':'coach_id'}"/>
diff --git a/addons/membership/membership_view.xml b/addons/membership/membership_view.xml
index 376e0bcaf9b..5cadd4077ec 100644
--- a/addons/membership/membership_view.xml
+++ b/addons/membership/membership_view.xml
@@ -84,9 +84,10 @@
<record model="ir.ui.view" id="product_normal_form_view">
<field name="name">Membership Products</field>
<field name="model">product.product</field>
+ <field name="priority">6</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
- <page string="Information" position="after">
+ <page string="Accounting" position="after">
<page string="Membership">
<group col="1">
<group>
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 2ed442b1831..2ec70a051f5 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -360,9 +360,9 @@
<label string="-" attrs="{'invisible':[('product_uos','=',False)]}" class="oe_inline"/>
<field name="product_uos" class="oe_inline"/>
</div>
+ <label for="routing_id" class="oe_inline" groups="mrp.group_mrp_routings"/>
<div groups="mrp.group_mrp_routings">
- <label for="routing_id" class="oe_edit_only"/>
- <h2><field name="routing_id" class="oe_inline"/></h2>
+ <field name="routing_id" class="oe_inline"/>
</div>
</group>
<group>
diff --git a/addons/mrp_byproduct/mrp_byproduct.py b/addons/mrp_byproduct/mrp_byproduct.py
index 9caf626834a..134f4ea4433 100644
--- a/addons/mrp_byproduct/mrp_byproduct.py
+++ b/addons/mrp_byproduct/mrp_byproduct.py
@@ -39,6 +39,7 @@ class mrp_subproduct(osv.osv):
}
_defaults={
'subproduct_type': 'variable',
+ 'product_qty': lambda *a: 1.0,
}
def onchange_product_id(self, cr, uid, ids, product_id, context=None):
diff --git a/addons/product/product.py b/addons/product/product.py
index fb28f85b10f..90536374031 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -323,7 +323,7 @@ class product_template(osv.osv):
help='Coefficient to convert default Unit of Measure to Unit of Sale\n'
' uos = uom * coeff'),
'mes_type': fields.selection((('fixed', 'Fixed'), ('variable', 'Variable')), 'Measure Type'),
- 'seller_ids': fields.one2many('product.supplierinfo', 'product_id', 'Partners'),
+ 'seller_ids': fields.one2many('product.supplierinfo', 'product_id', 'Supplier'),
'company_id': fields.many2one('res.company', 'Company', select=1),
}
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index f1554f08346..3e360594b19 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -124,7 +124,7 @@
</group>
</group>
</page>
- <page string="Sales" attrs="{'readonly':[('sale_ok','=',0)]}">
+ <page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}">
<group name="sale">
<group string="Sale Conditions">
<label for="warranty"/>
diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml
index c1500c48710..11c69a1946c 100644
--- a/addons/purchase/report/request_quotation.rml
+++ b/addons/purchase/report/request_quotation.rml
@@ -32,7 +32,6 @@
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
@@ -167,4 +166,4 @@
</para>
<para style="terp_default_9">[[ user.signature or '' ]]</para>
</story>
-</document>
+</document> \ No newline at end of file
diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml
index 0979a27d3b6..230c81a0bfc 100644
--- a/addons/purchase_requisition/purchase_requisition_view.xml
+++ b/addons/purchase_requisition/purchase_requisition_view.xml
@@ -182,7 +182,7 @@
<field name="model">product.product</field>
<field name="inherit_id" ref="procurement.product_form_view_procurement_button"/>
<field name="arch" type="xml">
- <field name="procure_method" position="before">
+ <field name="supply_method" position="after">
<field name="purchase_requisition"/>
</field>
</field>
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 45dc7a5819d..cc9be4ed9b3 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -198,7 +198,7 @@
</div>
<field name="price_unit"/>
<label for="discount" groups="sale.group_discount_per_so_line"/>
- <div groups="sale.group_discount_per_so_line">
+ <div name="discount" groups="sale.group_discount_per_so_line">
<field name="discount" class="oe_inline"/> %%
</div>
</group>