[MERGE] misc fixes: expenses, products, crm, sale

bzr revid: fp@tinyerp.com-20121022172639-u4l0ed99wr6znjew
This commit is contained in:
Fabien Pinckaers 2012-10-22 19:26:39 +02:00
commit cffa0d1ee4
16 changed files with 24 additions and 155 deletions

View File

@ -1,121 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Attendee form view -->
<record id="base_calendar_attendee_form_view" model="ir.ui.view">
<field name="name">calendar.attendee.form</field>
<field name="model">calendar.attendee</field>
<field name="arch" type="xml">
<form string="Invitation details" version="7.0">
<header>
<button name="do_tentative" states="needs-action,declined,accepted" string="Uncertain" type="object" class="oe_highlight"/>
<button name="do_accept" string="Accept" states="needs-action,tentative,declined" type="object" class="oe_highlight"/>
<button name="do_decline" string="Decline" states="needs-action,tentative,accepted" type="object" class="oe_highlight"/>
<field name="state" widget="statusbar"
statusbar_visible="tentative,needs-action,accepted" statusbar_colors='{"proforma":"blue"}'/>
</header>
<sheet>
<div class="oe_title">
<label for="email" string="Invitation To" class="oe_edit_only"/>
<h1>
<field name="email" class="oe_inline"/>
(<field name="language" class="oe_inline"/>)
</h1>
<h2>
From <field name="event_date" class="oe_inline"/>
to <field name="event_end_date" class="oe_inline"/>
</h2>
</div>
<group>
<group>
<field name="sent_by_uid" string="Invitation From"/>
<field name="user_id" string="Invited User"/>
<field name="partner_id" string="Contact"/>
</group>
<group>
<field name="cutype" string="Invitation Type"/>
<field name="role" string="Role"/>
<field name="rsvp"/>
<field name="ref" readonly="1"/>
</group>
</group>
<group>
<group string="Delegated From">
<field name="parent_ids" readonly="1" nolabel="1"/>
</group>
<group string="Delegated To" >
<field name="child_ids" readonly="1" nolabel="1"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!-- Attendee tree view -->
<record id="base_calendar_attendee_tree_view" model="ir.ui.view">
<field name="name">calendar.attendee.tree</field>
<field name="model">calendar.attendee</field>
<field name="arch" type="xml">
<tree string="Invitation details">
<field name="sent_by_uid" string="Invitation From"/>
<field name="role" string="My Role"/>
<field name="user_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="cutype" string="Invitation Type"/>
<field name="state"/>
<field name="rsvp" string="Required to Join"/>
</tree>
</field>
</record>
<!-- Attendee search view -->
<record id="base_calendar_attendee_search_view" model="ir.ui.view">
<field name="name">calendar.attendee.search</field>
<field name="model">calendar.attendee</field>
<field name="arch" type="xml">
<search string="Search Invitations">
<field name="email" string="Email"/>
<field name="event_date"/>
<filter icon="terp-gtk-jump-to-ltr" name="toreview" string="To Review" domain="[('state','=', 'needs-action')]" help="Invitations To Review"/>
<filter icon="terp-check" string="Accepted" domain="[('state','=', 'accepted')]" help="Accepted Invitations"/>
<filter icon="terp-dialog-close" string="Declined" domain="[('state','=', 'declined')]" help="Declined Invitations"/>
<filter icon="gtk-sort-descending" string="Delegated" domain="[('state','=', 'delegated')]" help="Delegated Invitations"/>
<field name="user_id" string="Responsible"/>
<field name="cutype" string="Invitation type"/>
<group expand="0" string="Group By...">
<filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Contact" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Type" icon="terp-stock_symbol-selection" help="Invitation Type" domain="[]" context="{'group_by':'cutype'}"/>
<filter string="Role" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'role'}"/>
<filter string="Required Reply" icon="terp-mail-replied" domain="[]" context="{'group_by':'rsvp'}"/>
<filter string="Status" icon="terp-stock_effects-object-colorize" help="Invitation Type"
domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<record id="action_view_attendee_form" model="ir.actions.act_window">
<field name="name">Event Invitations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">calendar.attendee</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="base_calendar.base_calendar_attendee_tree_view"/>
<field name="context">{'default_sent_by_uid': uid}</field>
</record>
<!-- Calendar's menu -->
<menuitem id="base.menu_calendar_configuration" name="Calendar"
parent="base.menu_base_config" sequence="50" groups="base.group_no_one"/>
<!-- Invitation menu -->
<menuitem id="menu_attendee_invitations"
parent="base.menu_calendar_configuration"
sequence="10" action="action_view_attendee_form"/>
<!-- Alarm form view -->
<record id="res_alarm_form_view" model="ir.ui.view">
<field name="name">res.alarm.form</field>

View File

@ -85,7 +85,6 @@ Dashboard for CRM will include:
'crm_lead_view.xml',
'crm_lead_menu.xml',
'crm_meeting_view.xml',
'crm_meeting_menu.xml',
'crm_meeting_shortcut_data.xml',

View File

@ -1,18 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<!-- Calendar Attendee Form View -->
<record id="attendee_form_view_inherit" model="ir.ui.view">
<field name="name">calendar.attendee.form.inherit</field>
<field name="model">calendar.attendee</field>
<field name="inherit_id" ref="base_calendar.base_calendar_attendee_form_view"/>
<field name="arch" type="xml">
<field name="ref" position="after">
<field name="categ_id" string="Event Type"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@ -123,7 +123,7 @@
OpenERP allows you to easily define all the calls to be done
by your sales team and follow up based on their summary.
</p><p>
You can use the import feature to massicely import a new list of
You can use the import feature to massively import a new list of
prospects to qualify.
</p>
</field>

View File

@ -70,19 +70,19 @@
<field name="date"/>
<field name="name"/>
<field name="partner_id"/>
<field name="partner_phone"/>
<field name="user_id"/>
<field name="categ_id" invisible="1"/>
<field name="create_date" invisible="1"/>
<field name="opportunity_id" invisible="1"/>
<button string="Meeting"
states="open,pending" icon="gtk-redo"
name="action_make_meeting" type="object"/>
<button string="Convert to Opportunity"
name="%(phonecall2opportunity_act)d"
states="open,pending"
icon="gtk-index"
type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
<button string="Meeting"
states="open,pending" icon="gtk-redo"
name="action_make_meeting" type="object"/>
<field name="partner_phone"/>
<field name="user_id"/>
<field name="categ_id" invisible="1"/>
<field name="create_date" invisible="1"/>
<field name="opportunity_id" invisible="1"/>
<field name="state"/>
<button name="case_open" string="Confirm" type="object"
states="draft,pending" icon="gtk-go-forward"/>

View File

@ -87,7 +87,7 @@ class crm_phonecall2phonecall(osv.osv_memory):
if 'user_id' in fields:
res.update({'user_id': phonecall.user_id and phonecall.user_id.id or False})
if 'date' in fields:
res.update({'date': phonecall.date})
res.update({'date': False})
if 'section_id' in fields:
res.update({'section_id': phonecall.section_id and phonecall.section_id.id or False})
if 'categ_id' in fields:

View File

@ -124,7 +124,8 @@ class crm_claim(base_stage, osv.osv):
'date': fields.datetime.now,
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.case', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
'active': lambda *a: 1
'active': lambda *a: 1,
'stage_id':lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c)
}
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):

View File

@ -118,8 +118,7 @@
<button name="case_cancel" string="Cancel" type="object"
states="draft,open,pending"/>
</span>
<field name="stage_id" widget="statusbar"
on_change="onchange_stage_id(stage_id)"/>
<field name="stage_id" widget="statusbar"/>
</header>
<sheet string="Claims">
<group>

View File

@ -10,7 +10,7 @@
<record id="product_expense_installer_tree_view" model="ir.ui.view">
<field name="name">product.product.tree</field>
<field name="model">product.product</field>
<field eval="7" name="priority"/>
<field eval="37" name="priority"/>
<field name="arch" type="xml">
<tree editable="bottom" string="Products">
<field name="name"/>

View File

@ -410,7 +410,7 @@ class product_pricelist_item(osv.osv):
'min_quantity': fields.integer('Min. Quantity', required=True, help="The rule only applies if the partner buys/sells equal to or more than this quantity."),
'sequence': fields.integer('Sequence', required=True, help="Gives the order in which the pricelist items will be checked. The evaluation gives highest priority to lowest sequence and stops as soon as a matching item is found."),
'base': fields.selection(_price_field_get, 'Based on', required=True, size=-1, help="The mode for computing the price for this rule."),
'base_pricelist_id': fields.many2one('product.pricelist', 'If Other Pricelist'),
'base_pricelist_id': fields.many2one('product.pricelist', 'Other Pricelist'),
'price_surcharge': fields.float('Price Surcharge',
digits_compute= dp.get_precision('Product Price'), help='Specify the fixed amount to add or substract(if negative) to the amount calculated with the discount.'),

View File

@ -92,7 +92,7 @@
</group>
<group col="4" string="Price Computation">
<field name="base"/>
<field name="base_pricelist_id" attrs="{'required': [('base','=', -1)], 'readonly': [('base','!=', -1)]}"/>
<field name="base_pricelist_id" attrs="{'invisible':[('base', '!=', -1)],'required': [('base','=', -1)], 'readonly': [('base','!=', -1)]}"/>
</group>
<group col="6" colspan="5">
<label string="New Price ="/>

View File

@ -76,7 +76,6 @@
</field>
</record>
</data>
</openerp>

View File

@ -716,6 +716,8 @@ class sale_order_line(osv.osv):
'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True),
'invoiced': fields.boolean('Invoiced', readonly=True),
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price'), readonly=True, states={'draft': [('readonly', False)]}),
'type': fields.selection([('make_to_stock', 'from stock'), ('make_to_order', 'on order')], 'Procurement Method', required=True, readonly=True, states={'draft': [('readonly', False)]},
help="If 'on order', it triggers a procurement when the sale order is confirmed to create a task, purchase order or manufacturing order linked to this sale order line."),
'price_subtotal': fields.function(_amount_line, string='Subtotal', digits_compute= dp.get_precision('Account')),
'tax_id': fields.many2many('account.tax', 'sale_order_tax', 'order_line_id', 'tax_id', 'Taxes', readonly=True, states={'draft': [('readonly', False)]}),
'address_allotment_id': fields.many2one('res.partner', 'Allotment Partner'),
@ -744,6 +746,7 @@ class sale_order_line(osv.osv):
'sequence': 10,
'invoiced': 0,
'state': 'draft',
'type': 'make_to_stock',
'price_unit': 0.0,
}

View File

@ -225,8 +225,8 @@
</group>
<group>
<field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
<field name="type"/>
<field name="th_weight"/>
<!-- we should put a config wizard for these two fields -->
<field name="address_allotment_id"/>
</group>
@ -473,12 +473,12 @@
</header>
<sheet>
<label for="order_id" class="oe_edit_only"/>
<h1><field name="order_id"/></h1>
<h1><field name="order_id" domain="[('state','!=','done')]"/></h1>
<label for="order_partner_id" class="oe_edit_only"/>
<h2><field name="order_partner_id"/></h2>
<group>
<group>
<field name="product_id" readonly="1"/>
<field name="product_id"/>
<label for="product_uom_qty"/>
<div>
<field name="product_uom_qty" readonly="1" class="oe_inline"/>

View File

@ -490,8 +490,6 @@ class sale_order_line(osv.osv):
_columns = {
'delay': fields.float('Delivery Lead Time', required=True, help="Number of days between the order confirmation the shipping of the products to the customer", readonly=True, states={'draft': [('readonly', False)]}),
'procurement_id': fields.many2one('procurement.order', 'Procurement'),
'type': fields.selection([('make_to_stock', 'from stock'), ('make_to_order', 'on order')], 'Procurement Method', required=True, readonly=True, states={'draft': [('readonly', False)]},
help="If 'on order', it triggers a procurement when the sale order is confirmed to create a task, purchase order or manufacturing order linked to this sale order line."),
'property_ids': fields.many2many('mrp.property', 'sale_order_line_property_rel', 'order_id', 'property_id', 'Properties', readonly=True, states={'draft': [('readonly', False)]}),
'product_packaging': fields.many2one('product.packaging', 'Packaging'),
'move_ids': fields.one2many('stock.move', 'sale_line_id', 'Inventory Moves', readonly=True),
@ -499,7 +497,6 @@ class sale_order_line(osv.osv):
}
_defaults = {
'delay': 0.0,
'type': 'make_to_stock',
'product_packaging': False,
}

View File

@ -80,19 +80,18 @@
</tree>
</field>
</field>
<xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/field[@name='th_weight']" position="before">
<xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/field[@name='type']" position="before">
<label for="delay"/>
<div>
<field name="delay" class="oe_inline"/> days
</div>
<field name="type"/>
</xpath>
<xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/field[@name='address_allotment_id']" position="after">
<field name="property_ids" widget="many2many_tags"
groups="sale.group_mrp_properties"/>
</xpath>
<xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/field[@name='tax_id']" position="before">
<field name="product_packaging" context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}" on_change="product_packaging_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, parent.partner_id, product_packaging, True, context)" domain="[('product_id','=',product_id)]" groups="product.group_stock_packaging" colspan="3"/>
<field name="product_packaging" context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}" on_change="product_packaging_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, parent.partner_id, product_packaging, True, context)" domain="[('product_id','=',product_id)]" groups="product.group_stock_packaging" />
</xpath>
<xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/div/field[@name='invoice_lines']" position="after">
<label for="move_ids"/>