[MERGE] merge with parent
bzr revid: rma@tinyerp.com-20121127051533-kpy6m65bna2e1ncg
This commit is contained in:
commit
c87ab693a3
|
@ -457,7 +457,7 @@ class account_invoice(osv.osv):
|
|||
invoice_addr_id = res['invoice']
|
||||
p = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
if company_id:
|
||||
if p.property_account_receivable.company_id.id != company_id and p.property_account_payable.company_id.id != company_id:
|
||||
if (p.property_account_receivable.company_id and (p.property_account_receivable.company_id.id != company_id)) and (p.property_account_payable.company_id and (p.property_account_payable.company_id.id != company_id)):
|
||||
property_obj = self.pool.get('ir.property')
|
||||
rec_pro_id = property_obj.search(cr,uid,[('name','=','property_account_receivable'),('res_id','=','res.partner,'+str(partner_id)+''),('company_id','=',company_id)])
|
||||
pay_pro_id = property_obj.search(cr,uid,[('name','=','property_account_payable'),('res_id','=','res.partner,'+str(partner_id)+''),('company_id','=',company_id)])
|
||||
|
@ -958,9 +958,14 @@ class account_invoice(osv.osv):
|
|||
})
|
||||
|
||||
date = inv.date_invoice or time.strftime('%Y-%m-%d')
|
||||
part = inv.partner_id.id
|
||||
|
||||
line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x, part, date, context=ctx)),iml)
|
||||
#if the chosen partner is not a company and has a parent company, use the parent for the journal entries
|
||||
#because you want to invoice 'Agrolait, accounting department' but the journal items are for 'Agrolait'
|
||||
part = inv.partner_id
|
||||
if part.parent_id and not part.is_company:
|
||||
part = part.parent_id
|
||||
|
||||
line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x, part.id, date, context=ctx)),iml)
|
||||
|
||||
line = self.group_lines(cr, uid, iml, line, inv)
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<group>
|
||||
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)" groups="account.group_account_user"/>
|
||||
<field name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]" widget="many2many_tags"/>
|
||||
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
|
@ -95,7 +95,7 @@
|
|||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="account_id" groups="account.group_account_user"/>
|
||||
<field name="account_analytic_id" domain="[('type','<>','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="account_analytic_id" domain="[('type','<>','view'), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="manual"/>
|
||||
<field name="amount"/>
|
||||
<field name="base" readonly="0"/>
|
||||
|
@ -199,7 +199,7 @@
|
|||
domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
|
||||
on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]"/>
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"
|
||||
on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
|
@ -229,7 +229,7 @@
|
|||
<tree editable="bottom" string="Taxes">
|
||||
<field name="name"/>
|
||||
<field name="account_id" groups="account.group_account_invoice"/>
|
||||
<field name="account_analytic_id" domain="[('type','<>','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="account_analytic_id" domain="[('type','<>','view'), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
|
||||
<field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
|
||||
|
||||
|
@ -354,7 +354,7 @@
|
|||
domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
|
||||
on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]"/>
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"
|
||||
on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
|
|
|
@ -166,28 +166,35 @@ class account_move_line(osv.osv):
|
|||
del data[f]
|
||||
return data
|
||||
|
||||
def _prepare_analytic_line(self, cr, uid, obj_line, context=None):
|
||||
"""
|
||||
Prepare the values given at the create() of account.analytic.line upon the validation of a journal item having
|
||||
an analytic account. This method is intended to be extended in other modules.
|
||||
|
||||
:param obj_line: browse record of the account.move.line that triggered the analytic line creation
|
||||
"""
|
||||
return {'name': obj_line.name,
|
||||
'date': obj_line.date,
|
||||
'account_id': obj_line.analytic_account_id.id,
|
||||
'unit_amount': obj_line.quantity,
|
||||
'product_id': obj_line.product_id and obj_line.product_id.id or False,
|
||||
'product_uom_id': obj_line.product_uom_id and obj_line.product_uom_id.id or False,
|
||||
'amount': (obj_line.credit or 0.0) - (obj_line.debit or 0.0),
|
||||
'general_account_id': obj_line.account_id.id,
|
||||
'journal_id': obj_line.journal_id.analytic_journal_id.id,
|
||||
'ref': obj_line.ref,
|
||||
'move_id': obj_line.id,
|
||||
'user_id': uid,
|
||||
}
|
||||
|
||||
def create_analytic_lines(self, cr, uid, ids, context=None):
|
||||
acc_ana_line_obj = self.pool.get('account.analytic.line')
|
||||
for obj_line in self.browse(cr, uid, ids, context=context):
|
||||
if obj_line.analytic_account_id:
|
||||
if not obj_line.journal_id.analytic_journal_id:
|
||||
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (obj_line.journal_id.name, ))
|
||||
amt = (obj_line.credit or 0.0) - (obj_line.debit or 0.0)
|
||||
vals_lines = {
|
||||
'name': obj_line.name,
|
||||
'date': obj_line.date,
|
||||
'account_id': obj_line.analytic_account_id.id,
|
||||
'unit_amount': obj_line.quantity,
|
||||
'product_id': obj_line.product_id and obj_line.product_id.id or False,
|
||||
'product_uom_id': obj_line.product_uom_id and obj_line.product_uom_id.id or False,
|
||||
'amount': amt,
|
||||
'general_account_id': obj_line.account_id.id,
|
||||
'journal_id': obj_line.journal_id.analytic_journal_id.id,
|
||||
'ref': obj_line.ref,
|
||||
'move_id': obj_line.id,
|
||||
'user_id': uid
|
||||
}
|
||||
acc_ana_line_obj.create(cr, uid, vals_lines)
|
||||
vals_line = self._prepare_analytic_line(cr, uid, obj_line, context=context)
|
||||
acc_ana_line_obj.create(cr, uid, vals_line)
|
||||
return True
|
||||
|
||||
def _default_get_move_form_hook(self, cursor, user, data):
|
||||
|
|
|
@ -1227,6 +1227,7 @@
|
|||
<field name="model">account.move.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Journal Items">
|
||||
<field name="name" filter_domain="['|', ('name','ilike',self), ('ref','ilike',self)]" string="Move"/>
|
||||
<field name="date"/>
|
||||
<filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
|
||||
<separator/>
|
||||
|
@ -1717,8 +1718,8 @@
|
|||
<field name="search_view_id" ref="view_model_search"/>
|
||||
</record>
|
||||
<menuitem
|
||||
action="action_model_form" id="menu_action_model_form" sequence="5"
|
||||
parent="account.menu_configuration_misc"/>
|
||||
action="action_model_form" name="Models" id="menu_action_model_form" sequence="5"
|
||||
parent="account.menu_finance_recurrent_entries"/>
|
||||
|
||||
<!--
|
||||
# Payment Terms
|
||||
|
@ -2064,7 +2065,7 @@
|
|||
<menuitem
|
||||
id="account_template_folder"
|
||||
name="Templates"
|
||||
parent="menu_finance_accounting"
|
||||
parent="account_account_menu"
|
||||
groups="account.group_account_manager"/>
|
||||
<menuitem
|
||||
id="account_template_taxes"
|
||||
|
@ -2083,28 +2084,23 @@
|
|||
<field name="model">account.account.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Template" version="7.0">
|
||||
<notebook>
|
||||
<page string="General Information">
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<newline/>
|
||||
<field name="parent_id"/>
|
||||
<field name="shortcut"/>
|
||||
<field name="type"/>
|
||||
<field name="user_type"/>
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<newline/>
|
||||
<field name="parent_id"/>
|
||||
<field name="shortcut"/>
|
||||
<field name="type"/>
|
||||
<field name="user_type"/>
|
||||
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
<field name="reconcile"/>
|
||||
<field name="chart_template_id"/>
|
||||
</group>
|
||||
<separator string="Default Taxes"/>
|
||||
<field name="tax_ids"/>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<field name="note"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
<field name="reconcile"/>
|
||||
<field name="chart_template_id"/>
|
||||
</group>
|
||||
<separator string="Default Taxes"/>
|
||||
<field name="tax_ids"/>
|
||||
<separator string="Notes"/>
|
||||
<field name="note" placeholder="Internal notes..."/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -102,11 +102,11 @@ class account_invoice_report(osv.osv):
|
|||
'due_delay': fields.float('Avg. Due Delay', readonly=True, group_operator="avg"),
|
||||
}
|
||||
_order = 'date desc'
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'account_invoice_report')
|
||||
cr.execute("""
|
||||
create or replace view account_invoice_report as (
|
||||
select min(ail.id) as id,
|
||||
|
||||
|
||||
def _select(self):
|
||||
select_str = """
|
||||
SELECT min(ail.id) as id,
|
||||
ai.date_invoice as date,
|
||||
to_char(ai.date_invoice, 'YYYY') as year,
|
||||
to_char(ai.date_invoice, 'MM') as month,
|
||||
|
@ -183,15 +183,30 @@ class account_invoice_report(osv.osv):
|
|||
where a.id=ai.id)
|
||||
ELSE 1
|
||||
END) / cr.rate as residual
|
||||
from account_invoice_line as ail
|
||||
"""
|
||||
return select_str
|
||||
|
||||
def _where(self):
|
||||
where_str = """
|
||||
WHERE cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id)
|
||||
and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) order by name desc limit 1)
|
||||
"""
|
||||
return where_str
|
||||
|
||||
def _from(self):
|
||||
from_str = """
|
||||
FROM account_invoice_line as ail
|
||||
left join account_invoice as ai ON (ai.id=ail.invoice_id)
|
||||
left join product_product pr on (pr.id=ail.product_id)
|
||||
left join product_template pt on (pt.id=pr.product_tmpl_id)
|
||||
left join product_uom u on (u.id=ail.uos_id),
|
||||
res_currency_rate cr
|
||||
where cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id)
|
||||
and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) order by name desc limit 1)
|
||||
group by ail.product_id,
|
||||
"""
|
||||
return from_str
|
||||
|
||||
def _group_by(self):
|
||||
group_by_str = """
|
||||
GROUP BY ail.product_id,
|
||||
ai.date_invoice,
|
||||
ai.id,
|
||||
cr.rate,
|
||||
|
@ -218,8 +233,15 @@ class account_invoice_report(osv.osv):
|
|||
ai.amount_total,
|
||||
u.uom_type,
|
||||
u.category_id
|
||||
)
|
||||
""")
|
||||
"""
|
||||
return group_by_str
|
||||
|
||||
def init(self, cr):
|
||||
# self._table = account_invoice_report
|
||||
tools.drop_view_if_exists(cr, self._table)
|
||||
cr.execute("CREATE or REPLACE VIEW %s as (%s %s %s %s)" % (
|
||||
self._table,
|
||||
self._select(), self._from(), self._where(), self._group_by()))
|
||||
|
||||
account_invoice_report()
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
import time
|
||||
date = self._get_date(cr, uid, {'lang': u'en_US', 'normal_view': False, 'active_model': 'ir.ui.menu',
|
||||
'search_default_journal_id': 1, 'journal_type': 'sale', 'search_default_period_id': 6, 'journal_id': 1, 'view_mode': False,
|
||||
'visible_id': 1, 'period_id': 6, 'tz': False, 'active_ids': [ref('menu_eaction_account_moves_sale')],
|
||||
'search_default_posted': 0, 'active_id': ref('menu_eaction_account_moves_sale')})
|
||||
'visible_id': 1, 'period_id': 6, 'tz': False, 'active_ids': [ref('menu_action_account_moves_all')],
|
||||
'search_default_posted': 0, 'active_id': ref('menu_action_account_moves_all')})
|
||||
partner = self.onchange_partner_id(cr, uid, [], False, ref('base.res_partner_12'), ref('account.cash'), debit=0, credit=2000, date=date, journal=False)
|
||||
account = self.onchange_account_id(cr, uid, [], account_id=ref('account.a_recv'), partner_id= ref('base.res_partner_12'))
|
||||
vals = {
|
||||
|
@ -62,11 +62,11 @@
|
|||
!python {model: account.move.line}: |
|
||||
ids = self._balance_search(cr, uid, self, 'balance', [('balance', '=', 2000.0)], None, {'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu',
|
||||
'search_default_journal_id': 1, 'journal_type': 'sale', 'search_default_period_id': 6, 'view_mode': False, 'visible_id': 1,
|
||||
'active_ids': [ref('menu_eaction_account_moves_sale')], 'search_default_posted': 0, 'active_id': ref('menu_eaction_account_moves_sale')})
|
||||
'active_ids': [ref('menu_action_account_moves_all')], 'search_default_posted': 0, 'active_id': ref('menu_action_account_moves_all')})
|
||||
bal = self._balance(cr, uid, ids[0][2], 'balance', None,{'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu',
|
||||
'search_default_journal_id': 1, 'journal_type': 'sale', 'search_default_period_id': 6, 'view_mode': False,
|
||||
'visible_id': 1, 'active_ids': [ref('menu_eaction_account_moves_sale')], 'search_default_posted': 0,
|
||||
'active_id': ref('menu_eaction_account_moves_sale')})
|
||||
'visible_id': 1, 'active_ids': [ref('menu_action_account_moves_all')], 'search_default_posted': 0,
|
||||
'active_id': ref('menu_action_account_moves_all')})
|
||||
assert bal, 'Balance has not been computed correctly'
|
||||
-
|
||||
I check that Initially account move state is "Draft"
|
||||
|
|
|
@ -12,51 +12,5 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_moves_sale" model="ir.actions.act_window">
|
||||
<field name="name">Journal Items</field>
|
||||
<field name="res_model">account.move.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_account_move_journal_form"/>
|
||||
<field name="context">{'journal_type':'sale','view_mode':False}</field>
|
||||
<field name="target">new</field>
|
||||
<field name="help">This view is used by accountants in order to record entries massively in OpenERP. If you want to record a customer invoice, select the journal and the period in the search toolbar. Then, start by recording the entry line of the income account. OpenERP will propose to you automatically the Tax related to this account and the counter-part "Account receivable".</field>
|
||||
</record>
|
||||
<menuitem action="action_account_moves_sale" sequence="16" id="menu_eaction_account_moves_sale"
|
||||
parent="menu_finance_receivables" icon="STOCK_JUSTIFY_FILL" groups="group_account_user,group_account_manager"/>
|
||||
|
||||
<record id="action_account_moves_purchase" model="ir.actions.act_window">
|
||||
<field name="name">Journal Items</field>
|
||||
<field name="res_model">account.move.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_account_move_journal_form"/>
|
||||
<field name="context">{'journal_type':'purchase','view_mode':False}</field>
|
||||
<field name="target">new</field>
|
||||
<field name="help">This view is used by accountants in order to record entries massively in OpenERP. If you want to record a supplier invoice, start by recording the line of the expense account, OpenERP will propose to you automatically the Tax related to this account and the counter-part "Account Payable".</field>
|
||||
</record>
|
||||
<menuitem action="action_account_moves_purchase"
|
||||
id="menu_eaction_account_moves_purchase"
|
||||
parent="menu_finance_payables"
|
||||
icon="STOCK_JUSTIFY_FILL"
|
||||
sequence="16"
|
||||
groups="group_account_user,group_account_manager"/>
|
||||
|
||||
<record id="action_account_moves_bank" model="ir.actions.act_window">
|
||||
<field name="name">Journal Items</field>
|
||||
<field name="res_model">account.move.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_account_move_journal_form"/>
|
||||
<field name="context">{'journal_type':'bank','view_mode':False}</field>
|
||||
<field name="target">new</field>
|
||||
<field name="help">This view is used by accountants in order to record entries massively in OpenERP. Journal items are created by OpenERP if you use Bank Statements, Cash Registers, or Customer/Supplier payments.</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
action="action_account_moves_bank"
|
||||
icon="STOCK_JUSTIFY_FILL"
|
||||
id="menu_action_account_moves_bank"
|
||||
parent="account.menu_finance_bank_and_cash"
|
||||
sequence="16"
|
||||
groups="group_account_user,group_account_manager"
|
||||
/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -19,18 +19,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_account_use_model" model="ir.actions.act_window">
|
||||
<field name="name">Manual Recurring</field>
|
||||
<field name="res_model">account.use.model</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_use_model"/>
|
||||
<field name="target">new</field>
|
||||
<field name="context">{'model_line':'model_line'}</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Manual Recurring" action="action_view_account_use_model" id="menu_action_manual_recurring" sequence="10" parent="account.menu_finance_recurrent_entries"/>
|
||||
|
||||
<record id="view_account_use_model_create_entry" model="ir.ui.view">
|
||||
<field name="name">account.use.model.create.entry.form</field>
|
||||
<field name="model">account.use.model</field>
|
||||
|
|
|
@ -296,11 +296,14 @@ class account_analytic_account(osv.osv):
|
|||
def _timesheet_ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None):
|
||||
lines_obj = self.pool.get('account.analytic.line')
|
||||
res = {}
|
||||
inv_ids = []
|
||||
for account in self.browse(cr, uid, ids, context=context):
|
||||
res[account.id] = 0.0
|
||||
line_ids = lines_obj.search(cr, uid, [('account_id','=', account.id), ('invoice_id','!=',False), ('to_invoice','!=', False), ('journal_id.type', '=', 'general')], context=context)
|
||||
for line in lines_obj.browse(cr, uid, line_ids, context=context):
|
||||
res[account.id] += line.invoice_id.amount_untaxed
|
||||
if line.invoice_id not in inv_ids:
|
||||
inv_ids.append(line.invoice_id)
|
||||
res[account.id] += line.invoice_id.amount_untaxed
|
||||
return res
|
||||
|
||||
def _remaining_ca_calc(self, cr, uid, ids, name, arg, context=None):
|
||||
|
|
|
@ -136,6 +136,7 @@ class account_analytic_account(osv.osv):
|
|||
'name': name,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'context':{'analytic_account':ids[0]},
|
||||
'domain' : domain,
|
||||
'res_model': 'hr.expense.expense',
|
||||
'nodestroy': True,
|
||||
|
|
|
@ -202,9 +202,7 @@ class base_stage(object):
|
|||
|
||||
def case_escalate(self, cr, uid, ids, context=None):
|
||||
""" Escalates case to parent level """
|
||||
cases = self.browse(cr, uid, ids, context=context)
|
||||
cases[0].state # fill browse record cache, for _action having old and new values
|
||||
for case in cases:
|
||||
for case in self.browse(cr, uid, ids, context=context):
|
||||
data = {'active': True}
|
||||
if case.section_id.parent_id:
|
||||
data['section_id'] = case.section_id.parent_id.id
|
||||
|
@ -215,8 +213,6 @@ class base_stage(object):
|
|||
raise osv.except_osv(_('Error!'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
|
||||
self.write(cr, uid, [case.id], data, context=context)
|
||||
case.case_escalate_send_note(case.section_id.parent_id, context=context)
|
||||
cases = self.browse(cr, uid, ids, context=context)
|
||||
self._action(cr, uid, cases, 'escalate', context=context)
|
||||
return True
|
||||
|
||||
def case_open(self, cr, uid, ids, context=None):
|
||||
|
@ -256,8 +252,7 @@ class base_stage(object):
|
|||
|
||||
def case_set(self, cr, uid, ids, new_state_name=None, values_to_update=None, new_stage_id=None, context=None):
|
||||
""" Generic method for setting case. This methods wraps the update
|
||||
of the record, as well as call to _action and browse_record
|
||||
case setting to fill the cache.
|
||||
of the record.
|
||||
|
||||
:params new_state_name: the new state of the record; this method
|
||||
will call ``stage_set_with_state_name``
|
||||
|
@ -271,7 +266,6 @@ class base_stage(object):
|
|||
update when writing values to the record.
|
||||
"""
|
||||
cases = self.browse(cr, uid, ids, context=context)
|
||||
cases[0].state # fill browse record cache, for _action having old and new values
|
||||
# 1. update the stage
|
||||
if new_state_name:
|
||||
self.stage_set_with_state_name(cr, uid, cases, new_state_name, context=context)
|
||||
|
@ -280,13 +274,14 @@ class base_stage(object):
|
|||
# 2. update values
|
||||
if values_to_update:
|
||||
self.write(cr, uid, ids, values_to_update, context=context)
|
||||
# 3. call _action for base action rule
|
||||
if new_state_name:
|
||||
self._action(cr, uid, cases, new_state_name, context=context)
|
||||
elif not (new_stage_id is None):
|
||||
new_state_name = self.read(cr, uid, ids, ['state'], context=context)[0]['state']
|
||||
self._action(cr, uid, cases, new_state_name, context=context)
|
||||
return True
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
res = super(base_stage,self).write(cr, uid, ids, vals, context)
|
||||
if vals.get('stage_id'):
|
||||
for case in self.browse(cr, uid, ids, context=context):
|
||||
self._action(cr, uid, case, case.stage_id.state, context=context)
|
||||
return res
|
||||
|
||||
def _action(self, cr, uid, cases, state_to, scrit=None, context=None):
|
||||
if context is None:
|
||||
|
|
|
@ -43,7 +43,7 @@ Thanks,
|
|||
</record>
|
||||
|
||||
<record id="filter_draft_lead" model="ir.filters">
|
||||
<field name="name">Filter on leads which are draft.</field>
|
||||
<field name="name">Draft Leads</field>
|
||||
<field name="model_id">crm.lead</field>
|
||||
<field name="domain">[('state','=','draft')]</field>
|
||||
<field name="user_id" eval="False"/>
|
||||
|
@ -62,7 +62,7 @@ Thanks,
|
|||
</record>
|
||||
|
||||
<record id="filter_usa_lead" model="ir.filters">
|
||||
<field name="name">Filter on leads which come from USA.</field>
|
||||
<field name="name">Leads from USA</field>
|
||||
<field name="model_id">crm.lead</field>
|
||||
<field name="domain">[('country_id','=','United States')]</field>
|
||||
<field name="user_id" eval="False"/>
|
||||
|
|
|
@ -210,7 +210,7 @@
|
|||
<field name="company_id"
|
||||
groups="base.group_multi_company"
|
||||
widget="selection" colspan="2"/>
|
||||
<field name="type_id" widget="selection"/>
|
||||
<field name="type_id"/>
|
||||
<field name="channel_id" widget="selection"/>
|
||||
<field name="referred"/>
|
||||
<field name="state" groups="base.group_no_one"/>
|
||||
|
@ -498,7 +498,7 @@
|
|||
</group>
|
||||
|
||||
<group string="Categorization">
|
||||
<field name="type_id" widget="selection"/>
|
||||
<field name="type_id" />
|
||||
<field name="channel_id" widget="selection"/>
|
||||
</group>
|
||||
<group string="Mailings">
|
||||
|
|
|
@ -127,6 +127,8 @@ class crm_phonecall(base_state, osv.osv):
|
|||
section_id = call.section_id and call.section_id.id or False
|
||||
if not user_id:
|
||||
user_id = call.user_id and call.user_id.id or False
|
||||
if not schedule_time:
|
||||
schedule_time = call.date
|
||||
vals = {
|
||||
'name' : call_summary,
|
||||
'user_id' : user_id or False,
|
||||
|
|
|
@ -15,20 +15,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_partners_form_crm3" model="ir.ui.view">
|
||||
<field name="name">view.res.partner.search.crm.inherited3</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_res_partner_filter"/>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@string='Group By...']" position="after">
|
||||
<group string="Display">
|
||||
<filter string="Show Sales Team" context="{'invisible_section': False}"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- open meetings related to given partner -->
|
||||
<record id="crm_meeting_partner" model="ir.actions.act_window">
|
||||
<field name="name">Meetings</field>
|
||||
|
|
|
@ -2,12 +2,6 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Top menu item -->
|
||||
<menuitem name="Project"
|
||||
id="base.menu_main_pm"
|
||||
groups="base.group_sale_salesman"
|
||||
sequence="40"/>
|
||||
|
||||
<menuitem id="base.menu_aftersale" name="After-Sale Services"
|
||||
groups="base.group_sale_salesman"
|
||||
parent="base.menu_base_partner" sequence="2" />
|
||||
|
@ -50,8 +44,6 @@
|
|||
parent="base.menu_aftersale" action="crm_case_categ_claim0" sequence="1"/>
|
||||
|
||||
<!-- Claim Stages -->
|
||||
<menuitem id="base.menu_definitions" name="Configuration" parent="base.menu_main_pm" sequence="60"/>
|
||||
<menuitem id="base.menu_project_config_project" name="Stages" parent="base.menu_definitions" sequence="1"/>
|
||||
<menuitem id="menu_claim_stage_view" name="Stages" action="crm_claim_stage_act" parent="menu_config_claim" sequence="20"/>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -31,10 +31,10 @@ class sale_order(osv.osv):
|
|||
'id': fields.integer('ID', readonly=True,invisible=True),
|
||||
}
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part):
|
||||
result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part)
|
||||
def onchange_partner_id(self, cr, uid, ids, part, context=None):
|
||||
result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part, context=context)
|
||||
if part:
|
||||
dtype = self.pool.get('res.partner').browse(cr, uid, part).property_delivery_carrier.id
|
||||
dtype = self.pool.get('res.partner').browse(cr, uid, part, context=context).property_delivery_carrier.id
|
||||
result['value']['carrier_id'] = dtype
|
||||
return result
|
||||
|
||||
|
|
|
@ -11,10 +11,9 @@
|
|||
<attribute name="string">Knowledge Application Configuration</attribute>
|
||||
</form>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<group string="Configure Directories">
|
||||
<label string="OpenERP's Document Management System supports mapping virtual folders with documents. The virtual folder of a document can be used to manage the files attached to the document, or to print and download any report. This tool will create directories automatically according to modules installed."/>
|
||||
<label align="0.0" string="When executing this wizard, it will configure your directories automatically according to modules installed."/>
|
||||
</group>
|
||||
<separator string="Configure Directories"/>
|
||||
<p>OpenERP's Document Management System supports mapping virtual folders with documents. The virtual folder of a document can be used to manage the files attached to the document, or to print and download any report. This tool will create directories automatically according to modules installed.</p>
|
||||
<p>When executing this wizard, it will configure your directories automatically according to modules installed.</p>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
{
|
||||
'name' : 'Email Gateway',
|
||||
'version' : '1.0',
|
||||
'depends' : ['base', 'mail'],
|
||||
'depends' : ['mail'],
|
||||
'author' : 'OpenERP SA',
|
||||
'category': 'Tools',
|
||||
'description': """
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
sequence="90"/>
|
||||
<menuitem id="menu_hr_main" parent="menu_hr_root" name="Human Resources" sequence="0"/>
|
||||
<menuitem id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root" groups="base.group_hr_manager" sequence="50"/>
|
||||
<menuitem id="menu_hr_management" name="Human Resources" parent="hr.menu_hr_configuration" groups="base.group_no_one" sequence="25"/>
|
||||
<menuitem id="menu_hr_reporting_timesheet" name="Reports"
|
||||
parent="menu_hr_reporting" sequence="6"/>
|
||||
|
||||
|
@ -288,7 +287,7 @@
|
|||
</record>
|
||||
|
||||
<record id="open_view_categ_form" model="ir.actions.act_window">
|
||||
<field name="name">Categories of Employees</field>
|
||||
<field name="name">Employee Tags</field>
|
||||
<field name="res_model">hr.employee.category</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
|
@ -297,14 +296,6 @@
|
|||
<menuitem action="open_view_categ_form" id="menu_view_employee_category_form"
|
||||
parent="hr.menu_hr_configuration" sequence="1" groups="base.group_no_one"/>
|
||||
|
||||
<record id="open_view_categ_tree" model="ir.actions.act_window">
|
||||
<field name="name">Categories Structure</field>
|
||||
<field name="res_model">hr.employee.category</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="view_id" ref="view_employee_category_tree"/>
|
||||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_employee_normal_action_tree" model="ir.actions.act_window">
|
||||
<field name="name">Employees</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -321,9 +312,6 @@
|
|||
<field eval="'ir.actions.act_window,%d'%hr_employee_normal_action_tree" name="value"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="open_view_categ_tree"
|
||||
id="menu_view_employee_category_tree" parent="menu_hr_management" groups="base.group_no_one" sequence="2"/>
|
||||
|
||||
<record id="view_hr_job_form" model="ir.ui.view">
|
||||
<field name="name">hr.job.form</field>
|
||||
<field name="model">hr.job</field>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
}
|
||||
|
||||
.oe_employee_details {
|
||||
width: 220px;
|
||||
width: 210px;
|
||||
font-size: 13px;
|
||||
padding: 2px 5px;
|
||||
color: #4c4c4c;
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
</group>
|
||||
<notebook>
|
||||
<page string="Description">
|
||||
<field name="line_ids" context="{'currency_id': currency_id}">
|
||||
<field name="line_ids" context="{'currency_id': currency_id, 'default_analytic_account': context.get('analytic_account')}">
|
||||
<form string="Expense Lines" version="7.0">
|
||||
<group>
|
||||
<group>
|
||||
|
@ -211,7 +211,7 @@
|
|||
<field name="search_view_id" ref="product.product_search_form_view"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_hr_product" name="Type of Expenses" parent="hr.menu_hr_configuration" action="hr_expense_product"/>
|
||||
<menuitem id="menu_hr_product" name="Types of Expenses" parent="hr.menu_hr_configuration" action="hr_expense_product"/>
|
||||
<menuitem id="next_id_49" name="Expenses" sequence="15" parent="hr.menu_hr_root"/>
|
||||
<menuitem action="expense_all" id="menu_expense_all" name="Expenses" parent="next_id_49"/>
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class hr_holidays_status(osv.osv):
|
|||
'categ_id': fields.many2one('crm.meeting.type', 'Meeting Type',
|
||||
help='Once a leave is validated, OpenERP will create a corresponding meeting of this type in the calendar.'),
|
||||
'color_name': fields.selection([('red', 'Red'),('blue','Blue'), ('lightgreen', 'Light Green'), ('lightblue','Light Blue'), ('lightyellow', 'Light Yellow'), ('magenta', 'Magenta'),('lightcyan', 'Light Cyan'),('black', 'Black'),('lightpink', 'Light Pink'),('brown', 'Brown'),('violet', 'Violet'),('lightcoral', 'Light Coral'),('lightsalmon', 'Light Salmon'),('lavender', 'Lavender'),('wheat', 'Wheat'),('ivory', 'Ivory')],'Color in Report', required=True, help='This color will be used in the leaves summary located in Reporting\Leaves by Department.'),
|
||||
'limit': fields.boolean('Allow to Override Limit', help='If you select this checkbox, the system allows the employees to take more leaves than the available ones for this type.'),
|
||||
'limit': fields.boolean('Allow to Override Limit', help='If you select this check box, the system allows the employees to take more leaves than the available ones for this type and take them into account for the "Remaining Legal Leaves" defined on the employee form.'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the leave type without removing it."),
|
||||
'max_leaves': fields.function(_user_left_days, string='Maximum Allowed', help='This value is given by the sum of all holidays requests with a positive value.', multi='user_left_days'),
|
||||
'leaves_taken': fields.function(_user_left_days, string='Leaves Already Taken', help='This value is given by the sum of all holidays requests with a negative value.', multi='user_left_days'),
|
||||
|
@ -146,15 +146,15 @@ class hr_holidays(osv.osv):
|
|||
'employee_id': fields.many2one('hr.employee', "Employee", select=True, invisible=False, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}, help='Leave Manager can let this field empty if this leave request/allocation is for every employee'),
|
||||
'manager_id': fields.many2one('hr.employee', 'First Approval', invisible=False, readonly=True, help='This area is automatically filled by the user who validate the leave'),
|
||||
'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
|
||||
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
|
||||
'number_of_days_temp': fields.float('Allocation', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
|
||||
'number_of_days': fields.function(_compute_number_of_days, string='Number of Days', store=True),
|
||||
'meeting_id': fields.many2one('crm.meeting', 'Meeting'),
|
||||
'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone", select=True),
|
||||
'parent_id': fields.many2one('hr.holidays', 'Parent'),
|
||||
'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',),
|
||||
'department_id':fields.related('employee_id', 'department_id', string='Department', type='many2one', relation='hr.department', readonly=True, store=True),
|
||||
'category_id': fields.many2one('hr.employee.category', "Category", help='Category of Employee', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
|
||||
'holiday_type': fields.selection([('employee','By Employee'),('category','By Employee Category')], 'Allocation Mode', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}, help='By Employee: Allocation/Request for individual Employee, By Employee Category: Allocation/Request for group of employees in category', required=True),
|
||||
'category_id': fields.many2one('hr.employee.category', "Employee Tag", help='Category of Employee', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
|
||||
'holiday_type': fields.selection([('employee','By Employee'),('category','By Employee Tag')], 'Allocation Mode', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}, help='By Employee: Allocation/Request for individual Employee, By Employee Tag: Allocation/Request for group of employees in category', required=True),
|
||||
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)'),
|
||||
'double_validation': fields.related('holiday_status_id', 'double_validation', type='boolean', relation='hr.holidays.status', string='Apply Double Validation'),
|
||||
}
|
||||
|
@ -541,7 +541,7 @@ class hr_employee(osv.osv):
|
|||
return result
|
||||
|
||||
_columns = {
|
||||
'remaining_leaves': fields.function(_get_remaining_days, string='Remaining Legal Leaves', fnct_inv=_set_remaining_days, type="float", help='Total number of legal leaves allocated to this employee, change this value to create allocation/leave requests.'),
|
||||
'remaining_leaves': fields.function(_get_remaining_days, string='Remaining Legal Leaves', fnct_inv=_set_remaining_days, type="float", help='Total number of legal leaves allocated to this employee, change this value to create allocation/leave request. Total based on all the leave types without overriding limit.'),
|
||||
'current_leave_state': fields.function(_get_leave_status, multi="leave_status", string="Current Leave Status", type="selection",
|
||||
selection=[('draft', 'New'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
|
||||
('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')]),
|
||||
|
|
|
@ -146,7 +146,10 @@
|
|||
<group>
|
||||
<field name="name" required="1" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
|
||||
<field name="holiday_status_id" context="{'employee_id':employee_id}"/>
|
||||
<field name="number_of_days_temp"/>
|
||||
<label for="number_of_days_temp"/>
|
||||
<div>
|
||||
<field name="number_of_days_temp" class="oe_inline"/> days
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="holiday_type" on_change="onchange_type(holiday_type)"/>
|
||||
|
@ -176,7 +179,7 @@
|
|||
<field name="department_id" invisible="1"/>
|
||||
<field name="holiday_status_id"/>
|
||||
<field name="name"/>
|
||||
<field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
|
||||
<field name="number_of_days" string="Allocated Days" sum="Remaining Days"/>
|
||||
<field name="manager_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<!--field name="type"/-->
|
||||
|
@ -257,12 +260,12 @@
|
|||
<menuitem name="Leaves" parent="hr.menu_hr_root" id="menu_open_ask_holidays" sequence="20"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="open_ask_holidays">
|
||||
<field name="name">My Leave Requests</field>
|
||||
<field name="name">Leave Requests</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="edit_holiday_new"/>
|
||||
<field name="context">{}</field>
|
||||
<field name="domain">[('type','=','remove'),('employee_id.user_id','=', uid)]</field>
|
||||
<field name="context">{'default_type': 'remove', 'search_default_my_leaves':1}</field>
|
||||
<field name="domain">[('type','=','remove')]</field>
|
||||
<field name="search_view_id" ref="view_hr_holidays_filter"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
|
@ -297,10 +300,10 @@
|
|||
<field name="act_window_id" ref="open_ask_holidays"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="My Leave Requests" parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
|
||||
<menuitem parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="request_approve_holidays">
|
||||
<field name="name">Requests Approve</field>
|
||||
<field name="name">Requests to Approve</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="context">{'default_type': 'remove', 'search_default_approve':1}</field>
|
||||
|
@ -326,11 +329,11 @@
|
|||
<menuitem name="Leave Requests to Approve" parent="menu_open_ask_holidays" id="menu_request_approve_holidays" action="request_approve_holidays" groups="base.group_hr_user"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="open_allocation_holidays">
|
||||
<field name="name">My Allocation Requests</field>
|
||||
<field name="name">Allocation Requests</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="context">{'default_type':'add'}</field>
|
||||
<field name="domain">[('type','=','add'),('employee_id.user_id','=', uid)]</field>
|
||||
<field name="context">{'default_type':'add', 'search_default_my_leaves':1}</field>
|
||||
<field name="domain">[('type','=','add')]</field>
|
||||
<field name="view_id" ref="allocation_leave_new"/>
|
||||
<field name="search_view_id" ref="view_hr_holidays_filter"/>
|
||||
</record>
|
||||
|
@ -349,7 +352,7 @@
|
|||
<field name="act_window_id" ref="open_allocation_holidays"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="My Allocation Requests" parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
|
||||
<menuitem parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="request_approve_allocation">
|
||||
<field name="name">Allocation Requests to Approve</field>
|
||||
|
@ -476,7 +479,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
|
||||
<menuitem name="Leave Type" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10"/>
|
||||
<menuitem name="Leaves Types" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10"/>
|
||||
|
||||
<!-- Holiday on resource leave -->
|
||||
<record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
|
||||
|
@ -541,7 +544,7 @@
|
|||
<group string="Leaves">
|
||||
<label for="remaining_leaves"/>
|
||||
<div>
|
||||
<field name="remaining_leaves" class="oe_inline"/>
|
||||
<field name="remaining_leaves" class="oe_inline"/> days
|
||||
</div>
|
||||
</group>
|
||||
</xpath>
|
||||
|
|
|
@ -195,7 +195,7 @@ class account_analytic_account(osv.osv):
|
|||
_inherit = 'account.analytic.account'
|
||||
_description = 'Analytic Account'
|
||||
_columns = {
|
||||
'use_timesheets': fields.boolean('Use Timesheets', help="Check this field if this project manages timesheets"),
|
||||
'use_timesheets': fields.boolean('Timesheets', help="Check this field if this project manages timesheets"),
|
||||
}
|
||||
|
||||
def on_change_template(self, cr, uid, ids, template_id, context=None):
|
||||
|
|
|
@ -127,31 +127,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Menus -->
|
||||
<record id="action_hr_analytic_timesheet_open_tree" model="ir.actions.act_window">
|
||||
<field name="name">Invoice Tasks Work</field>
|
||||
<field name="res_model">account.analytic.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{'search_default_to_invoice': 1}</field>
|
||||
<field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to add some tasks work to be invoiced.
|
||||
</p><p>
|
||||
This list shows every task you can invoice to the customer.
|
||||
Select the lines and invoice from the '<i>more...</i>' contextual
|
||||
menu to generate invoices automatically.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<menuitem
|
||||
action="action_hr_analytic_timesheet_open_tree"
|
||||
id="menu_hr_analytic_timesheet_tree"
|
||||
parent="account.menu_finance_periodical_processing_billing"
|
||||
sequence="1"/>
|
||||
|
||||
<record id="view_hr_timesheet_invoice_factor_search" model="ir.ui.view">
|
||||
<field name="name">hr_timesheet_invoice.factor.search</field>
|
||||
<field name="model">hr_timesheet_invoice.factor</field>
|
||||
|
|
|
@ -62,11 +62,7 @@ class account_analytic_line(osv.osv):
|
|||
if data is None:
|
||||
data = {}
|
||||
|
||||
account_ids = {}
|
||||
for line in self.pool.get('account.analytic.line').browse(cr, uid, ids, context=context):
|
||||
account_ids[line.account_id.id] = True
|
||||
|
||||
account_ids = account_ids.keys() #data['accounts']
|
||||
account_ids = [line.account_id.id for line in self.pool.get('account.analytic.line').browse(cr, uid, ids, context=context)]
|
||||
for account in analytic_account_obj.browse(cr, uid, account_ids, context=context):
|
||||
partner = account.partner_id
|
||||
if (not partner) or not (account.pricelist_id):
|
||||
|
@ -106,18 +102,18 @@ class account_analytic_line(osv.osv):
|
|||
last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context2)
|
||||
invoices.append(last_invoice)
|
||||
|
||||
cr.execute("SELECT product_id, user_id, to_invoice, sum(unit_amount), product_uom_id, name " \
|
||||
cr.execute("SELECT product_id, user_id, to_invoice, sum(unit_amount), product_uom_id " \
|
||||
"FROM account_analytic_line as line " \
|
||||
"WHERE account_id = %s " \
|
||||
"AND id IN %s AND to_invoice IS NOT NULL " \
|
||||
"GROUP BY product_id, user_id, to_invoice, product_uom_id, name", (account.id, tuple(ids),))
|
||||
"GROUP BY product_id, user_id, to_invoice, product_uom_id", (account.id, tuple(ids),))
|
||||
|
||||
for product_id, user_id, factor_id, qty, uom, line_name in cr.fetchall():
|
||||
for product_id, user_id, factor_id, qty, uom in cr.fetchall():
|
||||
if data.get('product'):
|
||||
product_id = data['product'][0]
|
||||
product = product_obj.browse(cr, uid, product_id, context=context2)
|
||||
if not product:
|
||||
raise osv.except_osv(_('Error!'), _('There is no product defined for the line %s. Please select one or force the product through the wizard.') % (line_name))
|
||||
raise osv.except_osv(_('Error!'), _('There is no product defined. Please select one or force the product through the wizard.'))
|
||||
factor = invoice_factor_obj.browse(cr, uid, factor_id, context=context2)
|
||||
factor_name = product_obj.name_get(cr, uid, [product_id], context=context2)[0][1]
|
||||
if factor.customer_name:
|
||||
|
|
|
@ -54,16 +54,10 @@
|
|||
<div t-if="widget.accounts.length == 0">
|
||||
<div class="oe_view_nocontent">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to add projects/analytic accounts you worked on.
|
||||
Click to add projects, contracts or analytic accounts.
|
||||
</p><p>
|
||||
You will be able to register your working hours and
|
||||
activities.
|
||||
</p><p>
|
||||
By default, you record timesheets on analytic accounts.
|
||||
But if an analytic account represents a customer
|
||||
contract, you can change the type of the analytic
|
||||
account to 'Contract or Project' to setup the invoicing
|
||||
options.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -68,20 +68,20 @@ class idea_idea(osv.osv):
|
|||
|
||||
def idea_cancel(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, { 'state': 'cancel' })
|
||||
self.message_post(cr, uid, ids, body=_('Idea canceled.'), context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea has been refused.'), context=context)
|
||||
return True
|
||||
|
||||
def idea_open(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state': 'open'}, context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea accepted.'), context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea has been opened.'), context=context)
|
||||
return True
|
||||
|
||||
def idea_close(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state': 'close'}, context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea closed.'), context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea has been accepted.'), context=context)
|
||||
return True
|
||||
|
||||
def idea_draft(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state': 'draft'}, context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea has been created.'), context=context)
|
||||
return True
|
||||
|
|
|
@ -67,7 +67,7 @@ class account_invoice(osv.osv):
|
|||
_columns = {
|
||||
### BVR reference type BVR or FREE
|
||||
'reference_type': fields.selection(_get_reference_type,
|
||||
'Reference Type', required=True),
|
||||
'Payment Reference', required=True),
|
||||
### Partner bank link between bank and partner id
|
||||
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',
|
||||
help='The partner bank account to pay\nKeep empty to use the default'
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<field name="interval_type">weeks</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall" />
|
||||
<field eval="'ir.module.module'" name="model" />
|
||||
<field eval="'publisher_warranty.contract'" name="model" />
|
||||
<field eval="'update_notification'" name="function" />
|
||||
<field eval="'(None,)'" name="args" />
|
||||
<field name="priority">1000</field>
|
||||
|
|
|
@ -80,8 +80,7 @@
|
|||
<field name="tag">mail.wall</field>
|
||||
<field name="context">{
|
||||
'default_model': 'res.users',
|
||||
'default_res_id': uid,
|
||||
'search_default_message_read': True
|
||||
'default_res_id': uid
|
||||
}</field>
|
||||
<field name="params" eval=""{
|
||||
'domain': ['|', ('notification_ids.partner_id.user_ids', 'in', [uid]), ('author_id.user_ids', 'in', [uid])],
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="action_client_marketing_menu" model="ir.actions.client">
|
||||
<field name="name">Open Marketing Menu</field>
|
||||
<field name="tag">reload</field>
|
||||
<field name="params" eval="{'menu_id': ref('base.marketing_menu')}"/>
|
||||
</record>
|
||||
|
||||
<record id="base.open_menu" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_client_marketing_menu"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
<data>
|
||||
|
||||
<menuitem name="Configuration" id="menu_marketing_configuration" parent="base.marketing_menu" sequence="1"/>
|
||||
|
|
|
@ -470,7 +470,7 @@ class mrp_production(osv.osv):
|
|||
'workcenter_lines': fields.one2many('mrp.production.workcenter.line', 'production_id', 'Work Centers Utilisation',
|
||||
readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'state': fields.selection(
|
||||
[('draft', 'New'), ('cancel', 'Cancelled'), ('picking_except', 'Picking Exception'), ('confirmed', 'Waiting Goods'),
|
||||
[('draft', 'New'), ('cancel', 'Cancelled'), ('picking_except', 'Picking Exception'), ('confirmed', 'Awaiting Raw Materials'),
|
||||
('ready', 'Ready to Produce'), ('in_production', 'Production Started'), ('done', 'Done')],
|
||||
string='Status', readonly=True,
|
||||
help="When the production order is created the status is set to 'Draft'.\n\
|
||||
|
|
|
@ -347,7 +347,7 @@
|
|||
<form string="Bill of Material" version="7.0">
|
||||
<group>
|
||||
<group>
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, name, context)" class="oe_inline"/>
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, name, context)" context="{'default_supply_method':'produce'}" class="oe_inline"/>
|
||||
<label for="product_qty" string="Quantity"/>
|
||||
<div>
|
||||
<field name="product_qty" class="oe_inline"/>
|
||||
|
@ -380,7 +380,7 @@
|
|||
<page string="Components">
|
||||
<field name="bom_lines" widget="one2many_list">
|
||||
<tree string="Components" editable="bottom">
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, name)"/>
|
||||
<field name="product_id" context="{'default_supply_method':'produce'}" on_change="onchange_product_id(product_id, name)"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
|
||||
<field name="name" invisible="1"/>
|
||||
|
|
|
@ -115,10 +115,10 @@ class mrp_repair(osv.osv):
|
|||
return result.keys()
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Repair Reference',size=24, required=True),
|
||||
'name': fields.char('Repair Reference',size=24, required=True, states={'confirmed':[('readonly',True)]}),
|
||||
'product_id': fields.many2one('product.product', string='Product to Repair', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'partner_id' : fields.many2one('res.partner', 'Partner', select=True, help='Choose partner for whom the order will be invoiced and delivered.'),
|
||||
'address_id': fields.many2one('res.partner', 'Delivery Address', domain="[('parent_id','=',partner_id)]"),
|
||||
'partner_id' : fields.many2one('res.partner', 'Partner', select=True, help='Choose partner for whom the order will be invoiced and delivered.', states={'confirmed':[('readonly',True)]}),
|
||||
'address_id': fields.many2one('res.partner', 'Delivery Address', domain="[('parent_id','=',partner_id)]", states={'confirmed':[('readonly',True)]}),
|
||||
'default_address_id': fields.function(_get_default_address, type="many2one", relation="res.partner"),
|
||||
'prodlot_id': fields.many2one('stock.production.lot', 'Lot Number', select=True, states={'draft':[('readonly',False)]},domain="[('product_id','=',product_id)]"),
|
||||
'state': fields.selection([
|
||||
|
@ -137,10 +137,10 @@ class mrp_repair(osv.osv):
|
|||
\n* The \'To be Invoiced\' status is used to generate the invoice before or after repairing done. \
|
||||
\n* The \'Done\' status is set when repairing is completed.\
|
||||
\n* The \'Cancelled\' status is used when user cancel repair order.'),
|
||||
'location_id': fields.many2one('stock.location', 'Current Location', select=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'location_dest_id': fields.many2one('stock.location', 'Delivery Location', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'location_id': fields.many2one('stock.location', 'Current Location', select=True, readonly=True, states={'draft':[('readonly',False)], 'confirmed':[('readonly',True)]}),
|
||||
'location_dest_id': fields.many2one('stock.location', 'Delivery Location', readonly=True, states={'draft':[('readonly',False)], 'confirmed':[('readonly',True)]}),
|
||||
'move_id': fields.many2one('stock.move', 'Move',required=True, domain="[('product_id','=',product_id)]", readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'guarantee_limit': fields.date('Warranty Expiration', help="The warranty expiration limit is computed as: last move date + warranty defined on selected product. If the current date is below the warranty expiration limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards."),
|
||||
'guarantee_limit': fields.date('Warranty Expiration', help="The warranty expiration limit is computed as: last move date + warranty defined on selected product. If the current date is below the warranty expiration limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards.", states={'confirmed':[('readonly',True)]}),
|
||||
'operations' : fields.one2many('mrp.repair.line', 'repair_id', 'Operation Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', help='Pricelist of the selected partner.'),
|
||||
'partner_invoice_id':fields.many2one('res.partner', 'Invoicing Address'),
|
||||
|
@ -156,7 +156,7 @@ class mrp_repair(osv.osv):
|
|||
'internal_notes': fields.text('Internal Notes'),
|
||||
'quotation_notes': fields.text('Quotation Notes'),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'deliver_bool': fields.boolean('Deliver', help="Check this box if you want to manage the delivery once the product is repaired and create a picking with selected product. Note that you can select the locations in the Info tab, if you have the extended view."),
|
||||
'deliver_bool': fields.boolean('Deliver', help="Check this box if you want to manage the delivery once the product is repaired and create a picking with selected product. Note that you can select the locations in the Info tab, if you have the extended view.", states={'confirmed':[('readonly',True)]}),
|
||||
'invoiced': fields.boolean('Invoiced', readonly=True),
|
||||
'repaired': fields.boolean('Repaired', readonly=True),
|
||||
'amount_untaxed': fields.function(_amount_untaxed, string='Untaxed Amount',
|
||||
|
|
|
@ -46,9 +46,9 @@
|
|||
<group>
|
||||
<field name="product_id" on_change="onchange_product_id(product_id)" domain="[('type','!=','service')]"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id,address_id)" attrs="{'required':[('invoice_method','!=','none')]}"/>
|
||||
<field name="address_id" attrs="{'readonly':[('deliver_bool','=', False)]}" groups="sale.group_delivery_invoice_address"/>
|
||||
<field name="address_id" groups="sale.group_delivery_invoice_address"/>
|
||||
<field name="move_id" on_change="onchange_move_id(product_id, move_id)" context="{'default_product_id':product_id}"/>
|
||||
<field name="location_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
|
||||
<field name="location_id" attrs="{'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
|
||||
<field name="prodlot_id" on_change="onchange_lot_id(prodlot_id,product_id)" groups="stock.group_production_lot" string="Serial Number"/>
|
||||
</group>
|
||||
<group>
|
||||
|
@ -109,9 +109,13 @@
|
|||
<group class="oe_subtotal_footer oe_right">
|
||||
<field name="amount_untaxed" sum="Untaxed amount"/>
|
||||
<field name="amount_tax"/>
|
||||
<field name="amount_total" sum="Total amount" class="oe_subtotal_footer_separator"/>
|
||||
<div class="oe_subtotal_footer_separator oe_inline">
|
||||
<label for="amount_total" />
|
||||
<button name="button_dummy"
|
||||
states="draft" string="(update)" type="object" class="oe_edit_only oe_link"/>
|
||||
</div>
|
||||
<field name="amount_total" nolabel="1" sum="Total amount" class="oe_subtotal_footer_separator"/>
|
||||
</group>
|
||||
<button name="button_dummy" states="draft" string="Compute" type="object" icon="terp-stock_format-scientific"/>
|
||||
<div class="oe_clear"/>
|
||||
</page>
|
||||
<page string="Invoicing">
|
||||
|
@ -173,7 +177,7 @@
|
|||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
|
||||
<field name="location_dest_id" attrs="{'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
<attribute name="string">Install Outlook Plug-In</attribute>
|
||||
</form>
|
||||
<xpath expr="//footer" position="replace">
|
||||
<footer>
|
||||
<button string="Close" special="Cancel" class="oe_highlight"/>
|
||||
</footer>
|
||||
<footer>
|
||||
<button string="Close" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
</xpath>
|
||||
<xpath expr="//separator[@string='title']" position="after" version="7.0">
|
||||
<group>
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
<attribute name="string">Install Thunderbird Plug-In</attribute>
|
||||
</form>
|
||||
<xpath expr="//footer" position="replace">
|
||||
<footer>
|
||||
<button string="Close" special="Cancel" class="oe_highlight"/>
|
||||
</footer>
|
||||
<footer>
|
||||
<button string="Close" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
</xpath>
|
||||
<xpath expr="//separator[@string='title']" position="after">
|
||||
<group>
|
||||
|
|
|
@ -618,9 +618,10 @@ class pos_order(osv.osv):
|
|||
return session_ids and session_ids[0] or False
|
||||
|
||||
def _default_pricelist(self, cr, uid, context=None):
|
||||
res = self.pool.get('sale.shop').search(cr, uid, [], context=context)
|
||||
if res:
|
||||
shop = self.pool.get('sale.shop').browse(cr, uid, res[0], context=context)
|
||||
session_ids = self._default_session(cr, uid, context)
|
||||
if session_ids:
|
||||
session_record = self.pool.get('pos.session').browse(cr, uid, session_ids, context=context)
|
||||
shop = self.pool.get('sale.shop').browse(cr, uid, session_record.config_id.shop_id.id, context=context)
|
||||
return shop.pricelist_id and shop.pricelist_id.id or False
|
||||
return False
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<field name="name"/>
|
||||
<field name="date_order"/>
|
||||
<field name="session_id" required="1"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_customer':1}" attrs="{'readonly': [('state','=','invoiced')]}"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, context)" context="{'search_default_customer':1}" attrs="{'readonly': [('state','=','invoiced')]}"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Products">
|
||||
|
@ -1060,7 +1060,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Ean13 Generator" version="7.0">
|
||||
<p class="oe_grey">
|
||||
Enter a reference for this product, it will be converted
|
||||
Enter a reference, it will be converted
|
||||
automatically to a valid EAN number.
|
||||
</p>
|
||||
<group>
|
||||
|
|
|
@ -19,7 +19,7 @@ class res_users(osv.osv):
|
|||
|
||||
def edit_ean(self, cr, uid, ids, context):
|
||||
return {
|
||||
'name': "Edit Ean",
|
||||
'name': "Edit EAN",
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<group>
|
||||
<field name="pos_config" />
|
||||
<field name="ean13" />
|
||||
<button name="edit_ean" type="object" string="Edit" />
|
||||
<button name="edit_ean" type="object" string="Edit EAN" class="oe_edit_only" />
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
|
|
@ -202,7 +202,7 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
|
|||
* {
|
||||
* quantity: (number) the number of items, or the weight,
|
||||
* unit_name: (string) the name of the item's unit (kg, dozen, ...)
|
||||
* list_price: (number) the price of one unit of the item before discount
|
||||
* price: (number) the price of one unit of the item before discount
|
||||
* discount: (number) the discount on the product in % [0,100]
|
||||
* product_name: (string) the name of the product
|
||||
* price_with_tax: (number) the price paid for this orderline, tax included
|
||||
|
|
|
@ -342,7 +342,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
|||
this.pos = options.pos;
|
||||
this.order = options.order;
|
||||
this.product = options.product;
|
||||
this.price = options.product.get('list_price');
|
||||
this.price = options.product.get('price');
|
||||
this.quantity = 1;
|
||||
this.discount = 0;
|
||||
this.type = 'unit';
|
||||
|
@ -396,11 +396,11 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
|||
return this.product;
|
||||
},
|
||||
// return the base price of this product (for this orderline)
|
||||
get_list_price: function(){
|
||||
get_price: function(){
|
||||
return this.price;
|
||||
},
|
||||
// changes the base price of the product for this orderline
|
||||
set_list_price: function(price){
|
||||
set_price: function(price){
|
||||
this.price = price;
|
||||
this.trigger('change');
|
||||
},
|
||||
|
@ -434,7 +434,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
|||
export_as_JSON: function() {
|
||||
return {
|
||||
qty: this.get_quantity(),
|
||||
price_unit: this.get_list_price(),
|
||||
price_unit: this.get_price(),
|
||||
discount: this.get_discount(),
|
||||
product_id: this.get_product().get('id'),
|
||||
};
|
||||
|
@ -444,7 +444,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
|||
return {
|
||||
quantity: this.get_quantity(),
|
||||
unit_name: this.get_unit().name,
|
||||
list_price: this.get_list_price(),
|
||||
price: this.get_price(),
|
||||
discount: this.get_discount(),
|
||||
product_name: this.get_product().get('name'),
|
||||
price_with_tax : this.get_price_with_tax(),
|
||||
|
@ -589,7 +589,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
|||
line.set_quantity(options.quantity);
|
||||
}
|
||||
if(options.price !== undefined){
|
||||
line.set_list_price(options.price);
|
||||
line.set_price(options.price);
|
||||
}
|
||||
|
||||
var last_orderline = this.getLastOrderline();
|
||||
|
@ -625,7 +625,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
|||
},
|
||||
getDiscountTotal: function() {
|
||||
return (this.get('orderLines')).reduce((function(sum, orderLine) {
|
||||
return sum + (orderLine.get_list_price() * (orderLine.get_discount()/100) * orderLine.get_quantity());
|
||||
return sum + (orderLine.get_price() * (orderLine.get_discount()/100) * orderLine.get_quantity());
|
||||
}), 0);
|
||||
},
|
||||
getTotalTaxExcluded: function() {
|
||||
|
|
|
@ -535,7 +535,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
|
|||
},
|
||||
get_product_price: function(){
|
||||
var product = this.get_product();
|
||||
return (product ? product.get('list_price') : 0) || 0;
|
||||
return (product ? product.get('price') : 0) || 0;
|
||||
},
|
||||
get_product_weight: function(){
|
||||
return this.weight || 0;
|
||||
|
|
|
@ -184,8 +184,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
|||
order.getSelectedLine().set_quantity(val);
|
||||
}else if( mode === 'discount'){
|
||||
order.getSelectedLine().set_discount(val);
|
||||
}else if( mode === 'list_price'){
|
||||
order.getSelectedLine().set_list_price(val);
|
||||
}else if( mode === 'price'){
|
||||
order.getSelectedLine().set_price(val);
|
||||
}
|
||||
} else {
|
||||
this.pos.get('selectedOrder').destroy();
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<button class="input-button number-char">7</button>
|
||||
<button class="input-button number-char">8</button>
|
||||
<button class="input-button number-char">9</button>
|
||||
<button class="mode-button" data-mode='list_price'>Price</button>
|
||||
<button class="mode-button" data-mode='price'>Price</button>
|
||||
<br />
|
||||
<button class="input-button" id="numpad-minus" >+/-</button>
|
||||
<button class="input-button number-char">0</button>
|
||||
|
@ -387,12 +387,12 @@
|
|||
<img src='' /> <!-- the product thumbnail -->
|
||||
<t t-if="!widget.model.get('to_weight')">
|
||||
<span class="price-tag">
|
||||
<t t-esc="widget.format_currency(widget.model.get('list_price'))"/>
|
||||
<t t-esc="widget.format_currency(widget.model.get('price'))"/>
|
||||
</span>
|
||||
</t>
|
||||
<t t-if="widget.model.get('to_weight')">
|
||||
<span class="price-tag">
|
||||
<t t-esc="widget.format_currency(widget.model.get('list_price'))+'/Kg'"/>
|
||||
<t t-esc="widget.format_currency(widget.model.get('price'))+'/Kg'"/>
|
||||
</span>
|
||||
</t>
|
||||
</div>
|
||||
|
@ -510,7 +510,7 @@
|
|||
</em>
|
||||
<t t-esc="widget.model.get_unit().name" />
|
||||
at
|
||||
<t t-esc="widget.format_currency(widget.model.get_list_price())" />
|
||||
<t t-esc="widget.format_currency(widget.model.get_price())" />
|
||||
/
|
||||
<t t-esc="widget.model.get_unit().name" />
|
||||
</li>
|
||||
|
@ -584,7 +584,7 @@
|
|||
<t t-esc="order.get_quantity().toFixed(0)"/>
|
||||
</td>
|
||||
<td class="pos-right-align">
|
||||
<t t-esc="widget.format_currency(order.get_list_price() * (1 - order.get_discount()/100) * order.get_quantity().toFixed(2))"/>
|
||||
<t t-esc="widget.format_currency(order.get_price() * (1 - order.get_discount()/100) * order.get_quantity().toFixed(2))"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -175,8 +175,8 @@ class purchase_order(osv.osv):
|
|||
help="Put an address if you want to deliver directly from the supplier to the customer. " \
|
||||
"Otherwise, keep empty to deliver to your own company."
|
||||
),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Destination Warehouse', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
|
||||
'location_id': fields.many2one('stock.location', 'Destination', required=True, domain=[('usage','<>','view')]),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Destination Warehouse'),
|
||||
'location_id': fields.many2one('stock.location', 'Destination', required=True, domain=[('usage','<>','view')], states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]} ),
|
||||
'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."),
|
||||
'currency_id': fields.related('pricelist_id', 'currency_id', type="many2one", relation="res.currency", readonly=True, required=True),
|
||||
'state': fields.selection(STATE_SELECTION, 'Status', readonly=True, help="The status of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' status. Then the order has to be confirmed by the user, the status switch to 'Confirmed'. Then the supplier must confirm the order to change the status to 'Approved'. When the purchase order is paid and received, the status becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the status becomes in exception.", select=True),
|
||||
|
@ -189,7 +189,7 @@ class purchase_order(osv.osv):
|
|||
'shipped_rate': fields.function(_shipped_rate, string='Received', type='float'),
|
||||
'invoiced': fields.function(_invoiced, string='Invoice Received', type='boolean', help="It indicates that an invoice has been paid"),
|
||||
'invoiced_rate': fields.function(_invoiced_rate, string='Invoiced', type='float'),
|
||||
'invoice_method': fields.selection([('manual','Based on Purchase Order lines'),('order','Based on generated draft invoice'),('picking','Based on incoming shipments')], 'Invoicing Control', required=True,
|
||||
'invoice_method': fields.selection([('manual','Based on Purchase Order lines'),('order','Based on generated draft invoice'),('picking','Based on incoming shipments')], 'Invoicing Control', required=True,states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]},
|
||||
help="Based on Purchase Order lines: place individual lines in 'Invoice Control > Based on P.O. lines' from where you can selectively create an invoice.\n" \
|
||||
"Based on generated invoice: create a draft invoice you can validate later.\n" \
|
||||
"Bases on incoming shipments: let you create an invoice when receptions are validated."
|
||||
|
@ -214,13 +214,13 @@ class purchase_order(osv.osv):
|
|||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
|
||||
'product_id': fields.related('order_line','product_id', type='many2one', relation='product.product', string='Product'),
|
||||
'create_uid': fields.many2one('res.users', 'Responsible'),
|
||||
'company_id': fields.many2one('res.company','Company',required=True,select=1),
|
||||
'company_id': fields.many2one('res.company','Company',required=True,select=1, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal'),
|
||||
}
|
||||
_defaults = {
|
||||
'date_order': fields.date.context_today,
|
||||
'state': 'draft',
|
||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'purchase.order'),
|
||||
'name': lambda obj, cr, uid, context: '/',
|
||||
'shipped': 0,
|
||||
'invoice_method': 'order',
|
||||
'invoiced': 0,
|
||||
|
@ -237,6 +237,8 @@ class purchase_order(osv.osv):
|
|||
_order = "name desc"
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if vals.get('name','/')=='/':
|
||||
vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'purchase.order') or '/'
|
||||
order = super(purchase_order, self).create(cr, uid, vals, context=context)
|
||||
if order:
|
||||
self.create_send_note(cr, uid, [order], context=context)
|
||||
|
|
|
@ -262,8 +262,7 @@
|
|||
<field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
</group>
|
||||
<div class="oe_clear"/>
|
||||
<label for="notes"/>
|
||||
<field name="notes" class="oe_inline"/>
|
||||
<field name="notes" class="oe_inline" placeholder="Terms and conditions..."/>
|
||||
</page>
|
||||
<page string="Incoming Shipments & Invoices">
|
||||
<group>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="Request for Quotation.pdf">
|
||||
<template title="Request for Quotation" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<document filename="requestforquotation.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="18.0" y1="42.0" width="535" height="758"/>
|
||||
<frame id="first" x1="23.0" y1="43.0" width="530" height="799"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
|
@ -10,7 +10,11 @@
|
|||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Address_Detail">
|
||||
<blockTableStyle id="Tableau1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Tableau2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
|
@ -33,6 +37,7 @@
|
|||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
|
@ -69,30 +74,26 @@
|
|||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<pto>
|
||||
<pto_header>
|
||||
<blockTable colWidths="371.0,98.0,61.0" repeatRows="1" style="Table_Product_Header_Title">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Expected Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Qty</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</pto_header>
|
||||
<para style="terp_default_9">[[repeatIn(objects,'order')]]</para>
|
||||
<para style="terp_default_9">[[ setLang(order.partner_id.lang) ]]</para>
|
||||
<blockTable colWidths="250.0,59.0,221.0" style="Table_Address_Detail">
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="250.0,59.0,221.0" style="Tableau1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Expected Delivery address:</para>
|
||||
<para style="terp_default_9">[[ (order.dest_address_id and order.dest_address_id.name) or (order.warehouse_id and order.warehouse_id.name) or '']]</para>
|
||||
<para style="terp_default_9">[[ order.dest_address_id and display_address(order.dest_address_id) ]] </para>
|
||||
<blockTable colWidths="250.0" style="Tableau2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Expected Delivery address:</para>
|
||||
<para style="terp_default_9">[[ (order.dest_address_id and order.dest_address_id.name) or (order.warehouse_id and order.warehouse_id.name) or '']]</para>
|
||||
<para style="P1">[[ order.dest_address_id and display_address(order.dest_address_id) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
|
@ -100,18 +101,18 @@
|
|||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ (order.partner_id.title and order.partner_id.title.name) or '' ]] [[ order.partner_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ display_address(order.partner_id) ]] </para>
|
||||
<para style="terp_default_9">[[ (order .partner_id and order.partner_id.title and order.partner_id.title.name) or '' ]] [[ (order .partner_id and order.partner_id.name) or '' ]] </para>
|
||||
<para style="terp_default_9">[[ order.partner_id and display_address(order .partner_id) ]] </para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">Tel.: [[ (order.partner_id.phone) or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">Fax: [[ (order.partner_id.fax) or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">TVA: [[ (order.partner_id.vat) or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">Tel.: [[ (order.partner_id and order.partner_id.phone) or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">Fax: [[ (order.partner_id and order.partner_id.fax) or removeParentNode('para') ]]</para>
|
||||
<para style="P1">TVA: [[ (order.partner_id and order.partner_id.vat) or removeParentNode('para') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_8">
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_header">Request for Quotation : [[order.name]]</para>
|
||||
|
@ -132,7 +133,7 @@
|
|||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_2">[[repeatIn(order.order_line,'order_line')]]</para>
|
||||
<para style="terp_default_9">[[ repeatIn(order.order_line,'order_line') ]]</para>
|
||||
<blockTable colWidths="370.0,100.0,39.0,20.0" style="Table_Product_Line">
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -148,6 +149,11 @@
|
|||
<para style="terp_default_Right_9">[[ (order_line.product_uom and order_line.product_uom.name) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8_italic">[[ format(order_line.notes or removeParentNode('tr')) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="terp_default_9">
|
||||
|
@ -165,6 +171,5 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">[[ user.signature or '' ]]</para>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
|
|
@ -295,12 +295,16 @@ class sale_order(osv.osv):
|
|||
}
|
||||
return {'warning': warning, 'value': value}
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part):
|
||||
def onchange_partner_id(self, cr, uid, ids, part, context=None):
|
||||
if not part:
|
||||
return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}}
|
||||
|
||||
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['delivery', 'invoice', 'contact'])
|
||||
part = self.pool.get('res.partner').browse(cr, uid, part)
|
||||
part = self.pool.get('res.partner').browse(cr, uid, part, context=context)
|
||||
#if the chosen partner is not a company and has a parent company, use the parent to choose the delivery, the
|
||||
#invoicing addresses and all the fields related to the partner.
|
||||
if part.parent_id and not part.is_company:
|
||||
part = part.parent_id
|
||||
addr = self.pool.get('res.partner').address_get(cr, uid, [part.id], ['delivery', 'invoice', 'contact'])
|
||||
pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False
|
||||
payment_term = part.property_payment_term and part.property_payment_term.id or False
|
||||
fiscal_position = part.property_account_position and part.property_account_position.id or False
|
||||
|
@ -355,7 +359,7 @@ class sale_order(osv.osv):
|
|||
'type': 'out_invoice',
|
||||
'reference': order.client_order_ref or order.name,
|
||||
'account_id': order.partner_id.property_account_receivable.id,
|
||||
'partner_id': order.partner_id.id,
|
||||
'partner_id': order.partner_invoice_id.id,
|
||||
'journal_id': journal_ids[0],
|
||||
'invoice_line': [(6, 0, lines)],
|
||||
'currency_id': order.pricelist_id.currency_id.id,
|
||||
|
|
|
@ -190,7 +190,7 @@
|
|||
</h1>
|
||||
<group>
|
||||
<group>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
|
||||
<field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}"/>
|
||||
<field name="partner_shipping_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}"/>
|
||||
<field name="project_id" context="{'partner_id':partner_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="sale.group_analytic_accounting" domain="[('type','in',['view','normal','contract'])]"/>
|
||||
|
|
|
@ -65,7 +65,7 @@ class sale_order_line_make_invoice(osv.osv_memory):
|
|||
'type': 'out_invoice',
|
||||
'reference': "P%dSO%d" % (order.partner_id.id, order.id),
|
||||
'account_id': a,
|
||||
'partner_id': order.partner_id.id,
|
||||
'partner_id': order.partner_invoice_id.id,
|
||||
'invoice_line': [(6, 0, lines)],
|
||||
'currency_id' : order.pricelist_id.currency_id.id,
|
||||
'comment': order.note,
|
||||
|
|
|
@ -139,7 +139,7 @@ class sale_advance_payment_inv(osv.osv_memory):
|
|||
'type': 'out_invoice',
|
||||
'reference': False,
|
||||
'account_id': sale.partner_id.property_account_receivable.id,
|
||||
'partner_id': sale.partner_id.id,
|
||||
'partner_id': sale.partner_invoice_id.id,
|
||||
'invoice_line': [(0, 0, inv_line_values)],
|
||||
'currency_id': sale.pricelist_id.currency_id.id,
|
||||
'comment': '',
|
||||
|
|
|
@ -21,5 +21,6 @@
|
|||
|
||||
import wizard
|
||||
import sale_crm
|
||||
import report
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -43,7 +43,8 @@ modules.
|
|||
'sale_crm_view.xml',
|
||||
'process/sale_crm_process.xml',
|
||||
'security/sale_crm_security.xml',
|
||||
'security/ir.model.access.csv'
|
||||
'security/ir.model.access.csv',
|
||||
'report/sale_crm_account_invoice_report_view.xml',
|
||||
],
|
||||
'demo': [],
|
||||
'test': ['test/sale_crm.yml'],
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import sales_crm_account_invoice_report
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Update account invoice !-->
|
||||
<record model="ir.ui.view" id="account_invoice_report_tree">
|
||||
<field name="name">account.invoice.report.tree</field>
|
||||
<field name="model">account.invoice.report</field>
|
||||
<field name="inherit_id" ref="account.view_account_invoice_report_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='date']" position="after">
|
||||
<field name="section_id"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,35 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from osv import fields,osv
|
||||
|
||||
class account_invoice_report(osv.osv):
|
||||
_inherit = 'account.invoice.report'
|
||||
_columns = {
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
}
|
||||
|
||||
def _select(self):
|
||||
return super(account_invoice_report, self)._select() + ", ai.section_id as section_id"
|
||||
|
||||
def _group_by(self):
|
||||
return super(account_invoice_report, self)._group_by() + ", ai.section_id"
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -46,4 +46,19 @@ class sale_order(osv.osv):
|
|||
|
||||
sale_order()
|
||||
|
||||
class res_users(osv.Model):
|
||||
_inherit = 'res.users'
|
||||
_columns = {
|
||||
'default_section_id': fields.many2one('crm.case.section', 'Default Sales Team'),
|
||||
}
|
||||
|
||||
class account_invoice(osv.osv):
|
||||
_inherit = 'account.invoice'
|
||||
_columns = {
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
}
|
||||
_defaults = {
|
||||
'section_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).default_section_id.id or False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -46,5 +46,72 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Update account invoice list view!-->
|
||||
<record model="ir.ui.view" id="account_invoice_tree">
|
||||
<field name="name">Account Invoice</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='date_invoice']" position="after">
|
||||
<field name="section_id" invisible="1"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_invoice_groupby_inherit" model="ir.ui.view">
|
||||
<field name="name">account.invoice.groupby</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group/filter[@string='Due Date']" position="after">
|
||||
<filter string="Sales Team" domain="[]" context="{'group_by':'section_id'}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Update account invoice !-->
|
||||
<record model="ir.ui.view" id="account_invoice_form">
|
||||
<field name="name">Account Invoice</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='user_id']" position="after">
|
||||
<field name="section_id"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Update user form !-->
|
||||
<record model="ir.ui.view" id="res_user_form">
|
||||
<field name="name">Users Preferences</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='email']" position="after">
|
||||
<field name="default_section_id"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Update Preferences form !-->
|
||||
<record id="view_users_form_preferences" model="ir.ui.view">
|
||||
<field name="name">res.users.preferences.form</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='company_id']" position="after">
|
||||
<field name="default_section_id"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -87,10 +87,10 @@ class sale(osv.osv):
|
|||
result.update(invoice_type_id=order.invoice_type_id and order.invoice_type_id.id or False)
|
||||
return result
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part):
|
||||
result = super(sale, self).onchange_partner_id(cr, uid, ids, part)
|
||||
def onchange_partner_id(self, cr, uid, ids, part, context=None):
|
||||
result = super(sale, self).onchange_partner_id(cr, uid, ids, part, context=context)
|
||||
if part:
|
||||
itype = self.pool.get('res.partner').browse(cr, uid, part).property_invoice_type
|
||||
itype = self.pool.get('res.partner').browse(cr, uid, part, context=context).property_invoice_type
|
||||
if itype:
|
||||
result['value']['invoice_type_id'] = itype.id
|
||||
return result
|
||||
|
|
|
@ -29,7 +29,13 @@ class picking(report_sxw.rml_parse):
|
|||
super(picking, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_product_desc':self.get_product_desc
|
||||
})
|
||||
def get_product_desc(self,move_line):
|
||||
desc = move_line.product_id.name
|
||||
if move_line.product_id.default_code:
|
||||
desc = '[' + move_line.product_id.default_code + ']' + ' ' + desc
|
||||
return desc
|
||||
|
||||
report_sxw.report_sxw('report.stock.picking.list','stock.picking','addons/stock/report/picking.rml',parser=picking)
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -162,12 +162,14 @@
|
|||
<para style="terp_default_Bold_9">Customer Address : [[ (picking.type == 'out' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="terp_default_Bold_9">Warehouse Address : [[ (picking.type == 'internal' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="terp_default_9">[[ (picking.partner_id and picking.partner_id.id and picking.partner_id.title.name) or '' ]] [[ picking.partner_id and picking.partner_id.id and picking.partner_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id,'delivery') ]]</para>
|
||||
<para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id) ]]</para>
|
||||
<para style="terp_default_9">[[ picking.partner_id.phone or picking.partner_id.email or removeParentNode('para')]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Contact Address :</para>
|
||||
<para style="terp_default_9">[[ picking.partner_id and picking.partner_id.title.name or '' ]] [[ picking.partner_id and picking.partner_id.name or '' ]]</para>
|
||||
<para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id,'default') ]] </para>
|
||||
<para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id) ]] </para>
|
||||
<para style="terp_default_9">[[ picking.partner_id.phone or picking.partner_id.email or removeParentNode('para')]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -189,7 +191,7 @@
|
|||
<para style="terp_default_5cm_Above_Space">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="100.0,100.0,108.0,107.0,109.0" style="Header_Order_Reference_Tbl">
|
||||
<blockTable colWidths="100.0,154.0,161.0,109.0" style="Header_Order_Reference_Tbl">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Journal</para>
|
||||
|
@ -198,17 +200,14 @@
|
|||
<para style="terp_tblheader_General_Centre">Order(Origin)</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Recipient</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Expected Shipping Date </para>
|
||||
<para style="terp_tblheader_General_Centre">Schedule Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Weight</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="100.0,100.0,108.0,107.0,109.0" style="Content_Order_Reference_Table">
|
||||
<blockTable colWidths="100.0,154.0,162.0,109.0" style="Content_Order_Reference_Table">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ picking.stock_journal_id.name]]</para>
|
||||
|
@ -216,9 +215,6 @@
|
|||
<td>
|
||||
<para style="terp_default_Centre_8">[[ picking.origin or '']]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ (picking.partner_id and picking.partner_id.title.name) or '' ]] [[ (picking.partner_id and picking.partner_id.name) or '' ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ formatLang(picking.min_date,date_time = True) ]]</para>
|
||||
</td>
|
||||
|
@ -236,7 +232,7 @@
|
|||
<para style="terp_tblheader_Details">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Lot</para>
|
||||
<para style="terp_tblheader_Details_Centre">Serial Number</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Status</para>
|
||||
|
@ -255,7 +251,7 @@
|
|||
<blockTable colWidths="256.0,74.0,58.0,60.0,73.0" style="Move_Line_Contect_Assign_State">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9"><font face="Helvetica" size="9.0">[ [[ (move_lines.product_id.default_code) or removeParentNode('font') ]] ]</font> [[ move_lines.product_id.name ]] [[ move_lines.product_id.variants or '']] </para>
|
||||
<para style="terp_default_9"><font face="Helvetica" size="9.0">[[ get_product_desc(move_lines) ]] </font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para>
|
||||
|
@ -280,7 +276,7 @@
|
|||
<blockTable colWidths="256.0,74.0,57.0,61.0,72.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9"><font face="Helvetica" size="9.0">[ [[ (move_lines.product_id.default_code) or removeParentNode('font') ]] ]</font> [[ move_lines.product_id.name ]] [[ move_lines.product_id.variants or '']]</para>
|
||||
<para style="terp_default_9"><font face="Helvetica" size="9.0">[[ get_product_desc(move_lines) ]] </font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para>
|
||||
|
|
|
@ -730,7 +730,7 @@ class stock_picking(osv.osv):
|
|||
model,view_id = mod_obj.get_object_reference(cr, uid, 'stock', 'view_picking_out_form')
|
||||
return super(stock_picking,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
|
||||
def onchange_partner_in(self, cr, uid, context=None, partner_id=None):
|
||||
def onchange_partner_in(self, cr, uid, ids, partner_id=None, context=None):
|
||||
return {}
|
||||
|
||||
def action_explode(self, cr, uid, moves, context=None):
|
||||
|
|
|
@ -1198,7 +1198,7 @@
|
|||
<record id="view_move_form" model="ir.ui.view">
|
||||
<field name="name">stock.move.form</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field eval="4" name="priority"/>
|
||||
<field eval="1" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Stock Moves" version="7.0">
|
||||
<header>
|
||||
|
@ -1247,7 +1247,7 @@
|
|||
<field name="date_expected" on_change="onchange_date(date,date_expected)"/>
|
||||
<field name="date" groups="base.group_no_one"/>
|
||||
</group>
|
||||
<group string="Tracability"
|
||||
<group string="Traceability"
|
||||
groups="stock.group_tracking_lot">
|
||||
<label for="tracking_id" groups="stock.group_tracking_lot"/>
|
||||
<div groups="stock.group_tracking_lot">
|
||||
|
@ -1307,6 +1307,7 @@
|
|||
<field name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" class="oe_inline"/>
|
||||
</div>
|
||||
<field name="product_packaging" groups="product.group_stock_packaging" domain="[('product_id','=',product_id)]"/>
|
||||
<field name="partner_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="create_date" invisible="1"/>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<field name="quantity" />
|
||||
<field name="product_uom" groups="product.group_uom"/>
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="prodlot_id" domain="[('product_id', '=', product_id)]" invisible="context.get('hide_tracking',False)" attrs="{'required':[('tracking','=',True)]}" groups="stock.group_production_lot"/>
|
||||
<field name="prodlot_id" context="{'default_product_id':product_id}" domain="[('product_id', '=', product_id)]" invisible="context.get('hide_tracking',False)" attrs="{'required':[('tracking','=',True)]}" groups="stock.group_production_lot"/>
|
||||
<!-- Removed as this feature is not logic: price must be updated upon reception of invoice -->
|
||||
<field name="update_cost" invisible="1"/>
|
||||
<field name="cost" invisible="1"/>
|
||||
|
|
|
@ -55,13 +55,13 @@ res_partner()
|
|||
|
||||
class sale_order(osv.osv):
|
||||
_inherit = 'sale.order'
|
||||
def onchange_partner_id(self, cr, uid, ids, part):
|
||||
def onchange_partner_id(self, cr, uid, ids, part, context=None):
|
||||
if not part:
|
||||
return {'value':{'partner_invoice_id': False, 'partner_shipping_id':False, 'payment_term' : False}}
|
||||
warning = {}
|
||||
title = False
|
||||
message = False
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, part)
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, part, context=context)
|
||||
if partner.sale_warn != 'no-message':
|
||||
if partner.sale_warn == 'block':
|
||||
raise osv.except_osv(_('Alert for %s !') % (partner.name), partner.sale_warn_msg)
|
||||
|
@ -72,7 +72,7 @@ class sale_order(osv.osv):
|
|||
'message': message,
|
||||
}
|
||||
|
||||
result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part)
|
||||
result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part, context=context)
|
||||
|
||||
if result.get('warning',False):
|
||||
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
||||
|
@ -149,7 +149,7 @@ account_invoice()
|
|||
class stock_picking(osv.osv):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
def onchange_partner_in(self, cr, uid, context, partner_id=None):
|
||||
def onchange_partner_in(self, cr, uid, ids, partner_id=None, context=None):
|
||||
if not partner_id:
|
||||
return {}
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
|
||||
|
@ -165,7 +165,7 @@ class stock_picking(osv.osv):
|
|||
'title': title,
|
||||
'message': message
|
||||
}
|
||||
result = super(stock_picking, self).onchange_partner_in(cr, uid, context, partner_id)
|
||||
result = super(stock_picking, self).onchange_partner_in(cr, uid, ids, partner_id, context)
|
||||
if result.get('warning',False):
|
||||
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
||||
warning['message'] = message and message + ' ' + result['warning']['message'] or result['warning']['message']
|
||||
|
@ -179,7 +179,7 @@ stock_picking()
|
|||
class stock_picking_in(osv.osv):
|
||||
_inherit = 'stock.picking.in'
|
||||
|
||||
def onchange_partner_in(self, cr, uid, context, partner_id=None):
|
||||
def onchange_partner_in(self, cr, uid, ids, partner_id=None, context=None):
|
||||
if not partner_id:
|
||||
return {}
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
|
||||
|
@ -195,7 +195,7 @@ class stock_picking_in(osv.osv):
|
|||
'title': title,
|
||||
'message': message
|
||||
}
|
||||
result = super(stock_picking_in, self).onchange_partner_in(cr, uid, context, partner_id)
|
||||
result = super(stock_picking_in, self).onchange_partner_in(cr, uid, ids, partner_id, context)
|
||||
if result.get('warning',False):
|
||||
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
||||
warning['message'] = message and message + ' ' + result['warning']['message'] or result['warning']['message']
|
||||
|
@ -205,7 +205,7 @@ class stock_picking_in(osv.osv):
|
|||
class stock_picking_out(osv.osv):
|
||||
_inherit = 'stock.picking.out'
|
||||
|
||||
def onchange_partner_in(self, cr, uid, context, partner_id=None):
|
||||
def onchange_partner_in(self, cr, uid, ids, partner_id=None, context=None):
|
||||
if not partner_id:
|
||||
return {}
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
|
||||
|
@ -221,7 +221,7 @@ class stock_picking_out(osv.osv):
|
|||
'title': title,
|
||||
'message': message
|
||||
}
|
||||
result = super(stock_picking_out, self).onchange_partner_in(cr, uid, context, partner_id)
|
||||
result = super(stock_picking_out, self).onchange_partner_in(cr, uid, ids, partner_id, context)
|
||||
if result.get('warning',False):
|
||||
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
||||
warning['message'] = message and message + ' ' + result['warning']['message'] or result['warning']['message']
|
||||
|
|
Loading…
Reference in New Issue