[MERGE] addons17

bzr revid: fp@tinyerp.com-20121015182034-90dl5erq7evfsd1p
This commit is contained in:
Fabien Pinckaers
2012-10-15 20:20:34 +02:00
12 changed files with 46 additions and 25 deletions
@@ -170,7 +170,7 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<filter string="Salesman" position="after">
<filter string="Salesperson" position="after">
<filter string="Activation" context="{'group_by' : 'activation'}" domain="[]" icon="terp-personal" />
</filter>
</field>
+10
View File
@@ -19,6 +19,7 @@
#
##############################################################################
from datetime import datetime, timedelta
from osv import fields, osv
from tools.translate import _
from openerp import SUPERUSER_ID
@@ -281,6 +282,15 @@ class event_event(osv.osv):
})
return {'value' : values}
def onchange_start_date(self, cr, uid, ids, date_begin=False, date_end=False, context=None):
res = {'value':{}}
if date_end:
return res
if date_begin and isinstance(date_begin, str):
date_begin = datetime.strptime(date_begin, "%Y-%m-%d %H:%M:%S")
date_end = date_begin + timedelta(hours=1)
res['value'] = {'date_end': date_end.strftime("%Y-%m-%d %H:%M:%S")}
return res
# ----------------------------------------
# OpenChatter methods and notifications
+1 -1
View File
@@ -133,7 +133,7 @@
</group>
<group>
<field name="type" on_change="onchange_event_type(type,context)" />
<field name="date_begin"/>
<field name="date_begin" on_change="onchange_start_date(date_begin,date_end)"/>
<field name="date_end"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
+11
View File
@@ -274,6 +274,17 @@ class mrp_bom(osv.osv):
return {'value': {'name': prod.name, 'product_uom': prod.uom_id.id}}
return {}
def onchange_uom(self, cr, uid, ids, product_id, product_uom, context=None):
res = {'value':{}}
if not product_uom or not product_id:
return res
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
uom = self.pool.get('product.uom').browse(cr, uid, product_uom, context=context)
if uom.category_id.id != product.uom_id.category_id.id:
res['warning'] = {'title': _('Warning'), 'message': _('The Product Unit of Measure you chose has a different category than in the product form.')}
res['value'].update({'product_uom': product.uom_id.id})
return res
def _bom_find(self, cr, uid, product_id, product_uom, properties=None):
""" Finds BoM for particular product and product uom.
@param product_id: Selected product.
+2 -2
View File
@@ -351,7 +351,7 @@
<label for="product_qty" string="Quantity"/>
<div>
<field name="product_qty" class="oe_inline"/>
<field name="product_uom" class="oe_inline" groups="product.group_uom"/>
<field name="product_uom" class="oe_inline" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
</div>
<label for="product_uos_qty" groups="product.group_uos"/>
<div groups="product.group_uos" >
@@ -382,7 +382,7 @@
<tree string="Components" editable="bottom">
<field name="product_id" on_change="onchange_product_id(product_id, name)"/>
<field name="product_qty"/>
<field name="product_uom" groups="product.group_uom"/>
<field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
<field name="name" invisible="1"/>
<field name="date_start"/>
<field name="date_stop"/>
+12
View File
@@ -22,6 +22,7 @@
from osv import fields
from osv import osv
import decimal_precision as dp
from tools.translate import _
class mrp_subproduct(osv.osv):
_name = 'mrp.subproduct'
@@ -51,6 +52,17 @@ class mrp_subproduct(osv.osv):
return {'value': v}
return {}
def onchange_uom(self, cr, uid, ids, product_id, product_uom, context=None):
res = {'value':{}}
if not product_uom or not product_id:
return res
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
uom = self.pool.get('product.uom').browse(cr, uid, product_uom, context=context)
if uom.category_id.id != product.uom_id.category_id.id:
res['warning'] = {'title': _('Warning'), 'message': _('The Product Unit of Measure you chose has a different category than in the product form.')}
res['value'].update({'product_uom': product.uom_id.id})
return res
mrp_subproduct()
class mrp_bom(osv.osv):
@@ -11,13 +11,13 @@
<field name="sub_products">
<tree string="sub products" editable="top">
<field name="product_id" on_change="onchange_product_id(product_id)"/>
<field name="product_uom" groups="product.group_uom"/>
<field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
<field name="product_qty"/>
<field name="subproduct_type"/>
</tree>
<form string="Sub Products">
<field name="product_id" on_change="onchange_product_id(product_id)"/>
<field name="product_uom" groups="product.group_uom"/>
<field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
<field name="product_qty"/>
<field name="subproduct_type"/>
</form>
+1 -1
View File
@@ -13,7 +13,7 @@
<filter string="Consumable" name="consumable" icon="terp-accessories-archiver" domain="[('type','=','consu')]" help="Consumable products"/>
<separator/>
<filter string="Can be Sold" name="filter_to_sell" icon="terp-accessories-archiver-minus" domain="[('sale_ok','=',1)]"/>
<field name="categ_id" operator="child_of"/>
<field name="categ_id"/>
<group expand="0" string="Context...">
<field name="pricelist_id" context="{'pricelist': self}" groups="product.group_sale_pricelist"/>
<field name="company_id" groups="base.group_multi_company"/>
+1 -1
View File
@@ -135,7 +135,7 @@
<field name="resource_calendar_id"/>
</group>
<group string="Miscellaneous" name="misc">
<field name="date"/>
<field name="date" string="End Date"/>
<field name="priority" groups="base.group_no_one"/>
<field name="active" attrs="{'invisible':[('state','in',['open', 'pending', 'template'])]}"/>
+2 -2
View File
@@ -42,10 +42,10 @@
</record>
<record model="ir.rule" id="project_public_members_rule">
<field name="name">public Members</field>
<field name="name">Public Members</field>
<field name="model_id" ref="model_project_project"/>
<field name="global" eval="True"/>
<field name="domain_force">['|','|',('privacy_visibility','in',[False,'public']),('members','in',[user.id]),('message_follower_ids','in',[user.partner_id.id])]</field>
<field name="domain_force">['|',('privacy_visibility','in',[False,'public']),('message_follower_ids','in',[user.partner_id.id])]</field>
</record>
<record model="ir.rule" id="task_comp_rule">
+1 -3
View File
@@ -78,8 +78,6 @@
<field name="arch" type="xml">
<field name="remaining_hours" position="after">
<field string="Timebox" name="timebox_id" invisible=" not context.get('gtd', False)"/>
<button name="prev_timebox" type="object" icon="gtk-go-back" string="Previous" states="draft,pending,open" invisible=" not context.get('gtd',False)"/>
<button name="next_timebox" type="object" icon="gtk-go-forward" string="Next" states="draft,pending,open" invisible=" not context.get('gtd',False)"/>
<field name="context_id" invisible="not context.get('context_show', False)" widget="selection"/>
<button name="do_reopen" states="done,cancelled" string="Reactivate" type="object" icon="gtk-convert" help="For reopening the tasks" invisible="not context.get('set_visible',False)"/>
</field>
@@ -123,7 +121,7 @@
<field name="context">{'set_editable':True,'set_visible':True,'gtd':True,'user_invisible':True, "search_default_open": 1}</field>
<field name="domain">[('user_id','=',uid)]</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,gantt,graph,kanban</field>
<field name="view_mode">kanban,tree,form,calendar,gantt,graph</field>
</record>
<menuitem action="open_gtd_task" id="menu_open_gtd_timebox_tree" parent="project.menu_project_management" sequence="10"/>
+2 -12
View File
@@ -440,16 +440,6 @@
<field name="search_view_id" ref="view_sales_order_filter"/>
</record>
<record id="view_order_line_graph" model="ir.ui.view">
<field name="name">sale.order.line.graph</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<graph string="Sales Order Lines">
<field name="product_id"/>
<field name="price_subtotal" operator="+"/>
</graph>
</field>
</record>
<record id="view_order_line_tree" model="ir.ui.view">
<field name="name">sale.order.line.tree</field>
@@ -562,7 +552,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_sales_order_uninvoiced_line_filter"/>
<field name="context">{"search_default_uninvoiced":1}</field>
<field name="filter" eval="True"/>
@@ -581,7 +571,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('invoiced','&lt;&gt;', 1),('state','=','done')]</field>
<field name="filter" eval="True"/>
</record>