[MERGE] addons-27 sale
bzr revid: qdp-launchpad@openerp.com-20121217110245-1rc9cl4x7r3l607j
This commit is contained in:
commit
f9e227717e
|
@ -113,20 +113,19 @@ class account_analytic_account(osv.osv):
|
|||
return res
|
||||
|
||||
def open_hr_expense(self, cr, uid, ids, context=None):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
|
||||
dummy, act_window_id = mod_obj.get_object_reference(cr, uid, 'hr_expense', 'expense_all')
|
||||
result = act_obj.read(cr, uid, act_window_id, context=context)
|
||||
|
||||
line_ids = self.pool.get('hr.expense.line').search(cr,uid,[('analytic_account', 'in', ids)])
|
||||
domain = [('line_ids', 'in', line_ids)]
|
||||
names = [record.name for record in self.browse(cr, uid, ids, context=context)]
|
||||
name = _('Expenses of %s') % ','.join(names)
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': name,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'context':{'analytic_account':ids[0]},
|
||||
'domain' : domain,
|
||||
'res_model': 'hr.expense.expense',
|
||||
'nodestroy': True,
|
||||
}
|
||||
result['domain'] = [('line_ids', 'in', line_ids)]
|
||||
names = [account.name for account in self.browse(cr, uid, ids, context=context)]
|
||||
result['name'] = _('Expenses of %s') % ','.join(names)
|
||||
result['context'] = {'analytic_account': ids[0]}
|
||||
result['view_type'] = 'form'
|
||||
return result
|
||||
|
||||
def hr_to_invoice_expense(self, cr, uid, ids, context=None):
|
||||
domain = [('invoice_id','=',False),('to_invoice','!=',False), ('journal_id.type', '=', 'purchase'), ('account_id', 'in', ids)]
|
||||
|
|
|
@ -173,18 +173,19 @@
|
|||
</page>
|
||||
<page string="Extra Info">
|
||||
<group>
|
||||
<group string="Categorization">
|
||||
<group string="Categorization" groups="base.group_multi_company,base.group_no_one" name="categorization">
|
||||
<field name="company_id"
|
||||
groups="base.group_multi_company"
|
||||
widget="selection" colspan="2"/>
|
||||
<field name="type_id"/>
|
||||
<field name="channel_id" widget="selection"/>
|
||||
<field name="referred"/>
|
||||
<field name="state" groups="base.group_no_one"/>
|
||||
</group>
|
||||
<group string="Mailings">
|
||||
<field name="opt_out"/>
|
||||
</group>
|
||||
<group string="Misc">
|
||||
<field name="active"/>
|
||||
<field name="referred"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
@ -463,12 +464,7 @@
|
|||
<field name="mobile"/>
|
||||
<field name="fax"/>
|
||||
</group>
|
||||
|
||||
<group string="Categorization">
|
||||
<field name="type_id" />
|
||||
<field name="channel_id" widget="selection"/>
|
||||
</group>
|
||||
<group string="Mailings">
|
||||
<group string="Mailings" name="mailings">
|
||||
<field name="opt_out"/>
|
||||
</group>
|
||||
<group string="Misc">
|
||||
|
|
|
@ -58,15 +58,16 @@
|
|||
<record id="view_expenses_form" model="ir.ui.view">
|
||||
<field name="name">hr.expense.form</field>
|
||||
<field name="model">hr.expense.expense</field>
|
||||
<field eval="25" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Expenses Sheet" version="7.0">
|
||||
<header>
|
||||
<button name="confirm" states="draft" string="Submit to Manager" type="workflow" class="oe_highlight"/>
|
||||
<button name="validate" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" groups="base.group_hr_user" />
|
||||
<button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" groups="base.group_hr_user" />
|
||||
<button name="done" states="accepted" string="Generate Accounting Entries" type="workflow" groups="account.group_account_invoice" class="oe_highlight"/>
|
||||
<button name="action_view_receipt" states="done" string="Open Receipt" type="object"/>
|
||||
<button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" groups="base.group_hr_user" />
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,accepted,done" statusbar_colors='{"confirm":"blue","cancelled":"red"}'/>
|
||||
</header>
|
||||
<sheet>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
{
|
||||
'name': 'Marketing',
|
||||
'version': '1.1',
|
||||
'depends': ['base', 'base_setup'],
|
||||
'depends': ['base', 'base_setup', 'crm'],
|
||||
'author': 'OpenERP SA',
|
||||
'category': 'Hidden/Dependency',
|
||||
'description': """
|
||||
|
|
|
@ -7,6 +7,32 @@
|
|||
id="base.marketing_menu"
|
||||
groups="marketing.group_marketing_user,marketing.group_marketing_manager"
|
||||
sequence="85"/>
|
||||
|
||||
<record id="view_crm_lead_form" model="ir.ui.view">
|
||||
<field name="name">crm.lead.inherit.form</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_form_view_leads"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='categorization']" position="attributes">
|
||||
<attribute name="string">Marketing</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="after">
|
||||
<field name="type_id"/>
|
||||
<field name="channel_id" widget="selection"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_crm_opportunity_form" model="ir.ui.view">
|
||||
<field name="name">crm.lead.inherit.form</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='mailings']" position="before">
|
||||
<group string="Marketing">
|
||||
<field name="type_id" />
|
||||
<field name="channel_id" widget="selection"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -489,7 +489,7 @@ class sale_order(osv.osv):
|
|||
# If date was specified, use it as date invoiced, usefull when invoices are generated this month and put the
|
||||
# last day of the last month as invoice date
|
||||
if date_inv:
|
||||
context['date_inv'] = date_inv
|
||||
context['date_invoice'] = date_inv
|
||||
for o in self.browse(cr, uid, ids, context=context):
|
||||
currency_id = o.pricelist_id.currency_id.id
|
||||
if (o.partner_id.id in partner_currency) and (partner_currency[o.partner_id.id] <> currency_id):
|
||||
|
|
|
@ -72,7 +72,8 @@ class sale_order_line_make_invoice(osv.osv_memory):
|
|||
'payment_term': pay_term,
|
||||
'fiscal_position': order.fiscal_position.id or order.partner_id.property_account_position.id,
|
||||
'user_id': order.user_id and order.user_id.id or False,
|
||||
'company_id': order.company_id and order.company_id.id or False
|
||||
'company_id': order.company_id and order.company_id.id or False,
|
||||
'date_invoice': fields.date.today(cr, uid, context=context),
|
||||
}
|
||||
inv_id = self.pool.get('account.invoice').create(cr, uid, inv)
|
||||
return inv_id
|
||||
|
|
|
@ -30,7 +30,8 @@ class sale_make_invoice(osv.osv_memory):
|
|||
'invoice_date': fields.date('Invoice Date'),
|
||||
}
|
||||
_defaults = {
|
||||
'grouped': False
|
||||
'grouped': False,
|
||||
'invoice_date': fields.date.context_today,
|
||||
}
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
|
|
Loading…
Reference in New Issue