[IMP] account*: adaptation due to the new Sale module
Major changes: - No use of UoS anymore - No analytic journal (journal_id) on account move lines Reason: complete rewrite of the Sale module. Responsible: fp, dbo, nim
This commit is contained in:
@@ -17,18 +17,6 @@
|
||||
<field name="applicability">accounts</field>
|
||||
</record>
|
||||
|
||||
<!-- Analytic journals -->
|
||||
<record id="analytic_journal_sale" model="account.analytic.journal">
|
||||
<field name="code">SAL</field>
|
||||
<field name="name">Sales</field>
|
||||
<field name="type">sale</field>
|
||||
</record>
|
||||
<record id="exp" model="account.analytic.journal">
|
||||
<field name="code">PUR</field>
|
||||
<field name="name">Purchases</field>
|
||||
<field name="type">purchase</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Payment term
|
||||
-->
|
||||
|
||||
@@ -100,12 +100,12 @@
|
||||
price_unit: 10.0
|
||||
quantity: 1.0
|
||||
product_id: product.product_product_39
|
||||
uos_id: product.product_uom_unit
|
||||
uom_id: product.product_uom_unit
|
||||
- name: 'Zed+ Antivirus'
|
||||
price_unit: 4.0
|
||||
quantity: 1.0
|
||||
product_id: product.product_product_43
|
||||
uos_id: product.product_uom_unit
|
||||
uom_id: product.product_uom_unit
|
||||
-
|
||||
!record {model: account.invoice, id: demo_invoice_january_wages}:
|
||||
company_id: base.main_company
|
||||
|
||||
@@ -7323,6 +7323,12 @@ msgstr ""
|
||||
#: model:ir.actions.act_window,help:account.action_account_operation_template
|
||||
msgid "Those can be used to quickly create a journal items when reconciling\n"
|
||||
" a bank statement or an account."
|
||||
|
||||
#. module: account
|
||||
#: field:account.analytic.line,product_uom_id:0
|
||||
#: field:account.invoice.line,uom_id:0
|
||||
#: field:account.move.line,product_uom_id:0
|
||||
msgid "Unit of Measure"
|
||||
msgstr ""
|
||||
|
||||
#. module: account
|
||||
@@ -8387,4 +8393,3 @@ msgstr ""
|
||||
#: model:ir.ui.view,arch_db:account.view_bank_statement_form
|
||||
msgid "→ Count"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -224,7 +224,6 @@ class AccountJournal(models.Model):
|
||||
company_id = fields.Many2one('res.company', string='Company', required=True, index=1, default=lambda self: self.env.user.company_id,
|
||||
help="Company related to this journal")
|
||||
|
||||
analytic_journal_id = fields.Many2one('account.analytic.journal', string='Analytic Journal', help="Journal for analytic entries")
|
||||
refund_sequence = fields.Boolean(string='Dedicated Refund Sequence', help="Check this box if you don't want to share the same sequence for invoices and refunds made from this journal", default=True)
|
||||
|
||||
inbound_payment_method_ids = fields.Many2many('account.payment.method', 'account_journal_inbound_payment_method_rel', 'journal_id', 'inbound_payment_method',
|
||||
|
||||
@@ -14,119 +14,24 @@ class AccountAnalyticLine(models.Model):
|
||||
general_account_id = fields.Many2one('account.account', string='Financial Account', ondelete='restrict',
|
||||
related='move_id.account_id', store=True, domain=[('deprecated', '=', False)])
|
||||
move_id = fields.Many2one('account.move.line', string='Move Line', ondelete='cascade', index=True)
|
||||
journal_id = fields.Many2one('account.analytic.journal', string='Analytic Journal', required=True, ondelete='restrict', index=True)
|
||||
code = fields.Char(size=8)
|
||||
ref = fields.Char(string='Ref.')
|
||||
currency_id = fields.Many2one('res.currency', related='move_id.currency_id', string='Account Currency', store=True, help="The related account currency if not equal to the company one.", readonly=True)
|
||||
amount_currency = fields.Monetary(related='move_id.amount_currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True)
|
||||
partner_id = fields.Many2one('res.partner', related='account_id.partner_id', string='Partner', store=True)
|
||||
|
||||
# Compute the cost based on the price type define into company
|
||||
# property_valuation_price_type property
|
||||
@api.v7
|
||||
def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, company_id,
|
||||
unit=False, journal_id=False, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if not journal_id:
|
||||
j_ids = self.pool.get('account.analytic.journal').search(cr, uid, [('type', '=', 'purchase')])
|
||||
journal_id = j_ids and j_ids[0] or False
|
||||
if not journal_id:
|
||||
return {}
|
||||
product_obj = self.pool.get('product.product')
|
||||
analytic_journal_obj = self.pool.get('account.analytic.journal')
|
||||
product_price_type_obj = self.pool.get('product.price.type')
|
||||
product_uom_obj = self.pool.get('product.uom')
|
||||
j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
|
||||
prod = product_obj.browse(cr, uid, prod_id, context=context)
|
||||
result = 0.0
|
||||
if prod_id:
|
||||
unit_obj = False
|
||||
if unit:
|
||||
unit_obj = product_uom_obj.browse(cr, uid, unit, context=context)
|
||||
if not unit_obj or prod.uom_id.category_id.id != unit_obj.category_id.id:
|
||||
unit = prod.uom_id.id
|
||||
if j_id.type == 'purchase':
|
||||
if not unit_obj or prod.uom_po_id.category_id.id != unit_obj.category_id.id:
|
||||
unit = prod.uom_po_id.id
|
||||
if j_id.type <> 'sale':
|
||||
a = prod.property_account_expense_id.id
|
||||
if not a:
|
||||
a = prod.categ_id.property_account_expense_categ_id.id
|
||||
else:
|
||||
a = prod.property_account_income_id.id
|
||||
if not a:
|
||||
a = prod.categ_id.property_account_income_categ_id.id
|
||||
|
||||
flag = False
|
||||
# Compute based on pricetype
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field', '=', 'standard_price')], context=context)
|
||||
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
|
||||
if journal_id:
|
||||
journal = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
|
||||
if journal.type == 'sale':
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field', '=', 'list_price')], context=context)
|
||||
if product_price_type_ids:
|
||||
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
|
||||
# Take the company currency as the reference one
|
||||
if pricetype.field == 'list_price':
|
||||
flag = True
|
||||
ctx = context.copy()
|
||||
if unit:
|
||||
# price_get() will respect a 'uom' in its context, in order
|
||||
# to return a default price for those units
|
||||
ctx['uom'] = unit
|
||||
amount_unit = prod.price_get(pricetype.field, context=ctx)
|
||||
if amount_unit:
|
||||
amount_unit = amount_unit[prod.id]
|
||||
else:
|
||||
amount_unit = 0.0
|
||||
|
||||
amount = amount_unit * quantity or 0.0
|
||||
cur_record = self.browse(cr, uid, id, context=context)
|
||||
currency = cur_record.exists() and cur_record.currency_id or prod.company_id.currency_id
|
||||
result = round(amount, currency.decimal_places)
|
||||
if not flag:
|
||||
result *= -1
|
||||
return {'value': {
|
||||
'amount': result,
|
||||
'general_account_id': a,
|
||||
'product_uom_id': unit
|
||||
}
|
||||
}
|
||||
|
||||
@api.v8
|
||||
@api.onchange('product_id', 'product_uom_id')
|
||||
def on_change_unit_amount(self):
|
||||
product_price_type_obj = self.env['product.price.type']
|
||||
|
||||
journal_id = self.journal_id
|
||||
if not journal_id:
|
||||
journal_id = self.env['account.analytic.journal'].search([('type', '=', 'purchase')], limit=1)
|
||||
if not journal_id or not self.product_id:
|
||||
return {}
|
||||
|
||||
result = 0.0
|
||||
unit = False
|
||||
if self.product_id:
|
||||
unit = self.product_uom_id.id
|
||||
if not self.product_uom_id or self.product_id.uom_id.category_id.id != self.product_uom_id.category_id.id:
|
||||
unit = self.product_id.uom_id.id
|
||||
if journal_id.type == 'purchase':
|
||||
if not self.product_uom_id or self.product_id.uom_po_id.category_id.id != self.product_uom_id.category_id.id:
|
||||
unit = self.product_id.uom_po_id.id
|
||||
if journal_id.type != 'sale':
|
||||
account = self.product_id.property_account_expense_id.id or self.product_id.categ_id.property_account_expense_categ_id.id
|
||||
if not account:
|
||||
raise UserError(_('There is no expense account defined ' \
|
||||
'for this product: "%s" (id:%d).') % \
|
||||
(self.product_id.name, self.product_id.id,))
|
||||
else:
|
||||
account = self.product_id.property_account_income_id.id or self.product_id.categ_id.property_account_income_categ_id.id
|
||||
if not account:
|
||||
raise UserError(_('There is no income account defined ' \
|
||||
'for this product: "%s" (id:%d).') % \
|
||||
(self.product_id.name, self.product_id.id,))
|
||||
account = self.product_id.property_account_income_id.id or self.product_id.categ_id.property_account_income_categ_id.id
|
||||
if not account: account = False
|
||||
|
||||
ctx = dict(self._context or {})
|
||||
if unit:
|
||||
@@ -134,17 +39,13 @@ class AccountAnalyticLine(models.Model):
|
||||
# to return a default price for those units
|
||||
ctx['uom'] = unit
|
||||
|
||||
# Compute based on pricetype
|
||||
amount_unit = 0.0
|
||||
pricetype = False
|
||||
amount_unit = 0.0
|
||||
if self.product_id:
|
||||
if journal_id.type == 'sale':
|
||||
pricetype = product_price_type_obj.search([('field', '=', 'list_price')], limit=1)
|
||||
else:
|
||||
pricetype = product_price_type_obj.search([('field', '=', 'standard_price')], limit=1)
|
||||
# Compute based on pricetype
|
||||
pricetype = product_price_type_obj.search([('field', '=', 'list_price')], limit=1)
|
||||
amount_unit = self.product_id.with_context(ctx).price_get(pricetype.field)[self.product_id.id]
|
||||
|
||||
amount = amount_unit * self.unit_amount
|
||||
amount = amount_unit * self.unit_amount or 0.0
|
||||
result = round(amount, self.currency_id.decimal_places)
|
||||
if pricetype and pricetype.field != 'list_price':
|
||||
result *= -1
|
||||
|
||||
@@ -70,16 +70,6 @@ class AccountInvoice(models.Model):
|
||||
journal = self._default_journal()
|
||||
return journal.currency_id or journal.company_id.currency_id
|
||||
|
||||
@api.model
|
||||
@api.returns('account.analytic.journal', lambda r: r.id)
|
||||
def _get_journal_analytic(self, inv_type):
|
||||
""" Return the analytic journal corresponding to the given invoice type. """
|
||||
journal_type = TYPE2JOURNAL.get(inv_type, 'sale')
|
||||
journal = self.env['account.analytic.journal'].search([('type', '=', journal_type)], limit=1)
|
||||
if not journal:
|
||||
raise UserError(_("You must define an analytic journal of type '%s'!") % (journal_type,))
|
||||
return journal
|
||||
|
||||
@api.model
|
||||
def _get_reference_type(self):
|
||||
return [('none', _('Free Reference'))]
|
||||
@@ -604,7 +594,7 @@ class AccountInvoice(models.Model):
|
||||
'price': line.price_subtotal,
|
||||
'account_id': line.account_id.id,
|
||||
'product_id': line.product_id.id,
|
||||
'uos_id': line.uos_id.id,
|
||||
'uom_id': line.uom_id.id,
|
||||
'account_analytic_id': line.account_analytic_id.id,
|
||||
'tax_ids': tax_ids,
|
||||
'invoice_id': self.id,
|
||||
@@ -777,7 +767,7 @@ class AccountInvoice(models.Model):
|
||||
'currency_id': line.get('currency_id', False),
|
||||
'quantity': line.get('quantity', 1.00),
|
||||
'product_id': line.get('product_id', False),
|
||||
'product_uom_id': line.get('uos_id', False),
|
||||
'product_uom_id': line.get('uom_id', False),
|
||||
'analytic_account_id': line.get('account_analytic_id', False),
|
||||
'invoice_id': line.get('invoice_id', False),
|
||||
'tax_ids': line.get('tax_ids', False),
|
||||
@@ -983,8 +973,6 @@ class AccountInvoiceLine(models.Model):
|
||||
@api.multi
|
||||
def _get_analytic_line(self):
|
||||
ref = self.invoice_id.number
|
||||
if not self.invoice_id.journal_id.analytic_journal_id:
|
||||
raise UserError(_("No Analytic Journal! You have to define an analytic journal on the '%s' journal!") % (self.invoice_id.journal_id.name,))
|
||||
return {
|
||||
'name': self.name,
|
||||
'date': self.invoice_id.date_invoice,
|
||||
@@ -992,9 +980,8 @@ class AccountInvoiceLine(models.Model):
|
||||
'unit_amount': self.quantity,
|
||||
'amount': self.price_subtotal_signed,
|
||||
'product_id': self.product_id.id,
|
||||
'product_uom_id': self.uos_id.id,
|
||||
'product_uom_id': self.uom_id.id,
|
||||
'general_account_id': self.account_id.id,
|
||||
'journal_id': self.invoice_id.journal_id.analytic_journal_id.id,
|
||||
'ref': ref,
|
||||
}
|
||||
|
||||
@@ -1028,7 +1015,7 @@ class AccountInvoiceLine(models.Model):
|
||||
help="Gives the sequence of this line when displaying the invoice.")
|
||||
invoice_id = fields.Many2one('account.invoice', string='Invoice Reference',
|
||||
ondelete='cascade', index=True)
|
||||
uos_id = fields.Many2one('product.uom', string='Unit of Measure',
|
||||
uom_id = fields.Many2one('product.uom', string='Unit of Measure',
|
||||
ondelete='set null', index=True)
|
||||
product_id = fields.Many2one('product.product', string='Product',
|
||||
ondelete='restrict', index=True)
|
||||
@@ -1109,7 +1096,7 @@ class AccountInvoiceLine(models.Model):
|
||||
if not self.product_id:
|
||||
if type not in ('in_invoice', 'in_refund'):
|
||||
self.price_unit = 0.0
|
||||
domain['uos_id'] = []
|
||||
domain['uom_id'] = []
|
||||
else:
|
||||
if part.lang:
|
||||
product = self.product_id.with_context(lang=part.lang)
|
||||
@@ -1130,9 +1117,9 @@ class AccountInvoiceLine(models.Model):
|
||||
if product.description_sale:
|
||||
self.name += '\n' + product.description_sale
|
||||
|
||||
if not self.uos_id or product.uom_id.category_id.id != self.uos_id.category_id.id:
|
||||
self.uos_id = product.uom_id.id
|
||||
domain['uos_id'] = [('category_id', '=', product.uom_id.category_id.id)]
|
||||
if not self.uom_id or product.uom_id.category_id.id != self.uom_id.category_id.id:
|
||||
self.uom_id = product.uom_id.id
|
||||
domain['uom_id'] = [('category_id', '=', product.uom_id.category_id.id)]
|
||||
|
||||
if company and currency:
|
||||
if company.currency_id != currency:
|
||||
@@ -1140,9 +1127,9 @@ class AccountInvoiceLine(models.Model):
|
||||
self.price_unit = product.standard_price
|
||||
self.price_unit = self.price_unit * currency.with_context(dict(self._context or {}, date=self.date_invoice)).rate
|
||||
|
||||
if self.uos_id and self.uos_id.id != product.uom_id.id:
|
||||
if self.uom_id and self.uom_id.id != product.uom_id.id:
|
||||
self.price_unit = self.env['product.uom']._compute_price(
|
||||
product.uom_id.id, self.price_unit, self.uos_id.id)
|
||||
product.uom_id.id, self.price_unit, self.uom_id.id)
|
||||
return {'domain': domain}
|
||||
|
||||
@api.onchange('account_id')
|
||||
@@ -1155,20 +1142,20 @@ class AccountInvoiceLine(models.Model):
|
||||
else:
|
||||
self._set_taxes()
|
||||
|
||||
@api.onchange('uos_id')
|
||||
def _onchange_uos_id(self):
|
||||
@api.onchange('uom_id')
|
||||
def _onchange_uom_id(self):
|
||||
warning = {}
|
||||
result = {}
|
||||
self._onchange_product_id()
|
||||
if not self.uos_id:
|
||||
if not self.uom_id:
|
||||
self.price_unit = 0.0
|
||||
if self.product_id and self.uos_id:
|
||||
if self.product_id.uom_id.category_id.id != self.uos_id.category_id.id:
|
||||
if self.product_id and self.uom_id:
|
||||
if self.product_id.uom_id.category_id.id != self.uom_id.category_id.id:
|
||||
warning = {
|
||||
'title': _('Warning!'),
|
||||
'message': _('The selected unit of measure is not compatible with the unit of measure of the product.'),
|
||||
}
|
||||
self.uos_id = self.product_id.uom_id.id
|
||||
self.uom_id = self.product_id.uom_id.id
|
||||
if warning:
|
||||
result['warning'] = warning
|
||||
return result
|
||||
|
||||
@@ -1064,8 +1064,6 @@ class AccountMoveLine(models.Model):
|
||||
"""
|
||||
for obj_line in self:
|
||||
if obj_line.analytic_account_id:
|
||||
if not obj_line.journal_id.analytic_journal_id:
|
||||
raise UserError(_("You have to define an analytic journal on the '%s' journal!") % (obj_line.journal_id.name, ))
|
||||
if obj_line.analytic_line_ids:
|
||||
obj_line.analytic_line_ids.unlink()
|
||||
vals_line = obj_line._prepare_analytic_line()[0]
|
||||
@@ -1085,7 +1083,6 @@ class AccountMoveLine(models.Model):
|
||||
'product_uom_id': self.product_uom_id and self.product_uom_id.id or False,
|
||||
'amount': (self.credit or 0.0) - (self.debit or 0.0),
|
||||
'general_account_id': self.account_id.id,
|
||||
'journal_id': self.journal_id.analytic_journal_id.id,
|
||||
'ref': self.ref,
|
||||
'move_id': self.id,
|
||||
'user_id': self.invoice_id.user_id.id or self._uid,
|
||||
|
||||
@@ -135,20 +135,6 @@ class AccountChartTemplate(models.Model):
|
||||
|
||||
@api.multi
|
||||
def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None):
|
||||
def _get_analytic_journal(journal_type):
|
||||
# Get the analytic journal
|
||||
data = False
|
||||
try:
|
||||
if journal['type'] == 'sale':
|
||||
data = self.env.ref('account.analytic_journal_sale')
|
||||
elif journal['type'] == 'purchase':
|
||||
data = self.env.ref('account.exp')
|
||||
elif journal['type'] == 'general':
|
||||
pass
|
||||
except ValueError:
|
||||
pass
|
||||
return data and data.id or False
|
||||
|
||||
def _get_default_account(journal_vals, type='debit'):
|
||||
# Get the default accounts
|
||||
default_account = False
|
||||
@@ -178,7 +164,6 @@ class AccountChartTemplate(models.Model):
|
||||
'name': journal['name'],
|
||||
'code': journal['code'],
|
||||
'company_id': company.id,
|
||||
'analytic_journal_id': _get_analytic_journal(journal),
|
||||
'default_credit_account_id': _get_default_account(journal, 'credit'),
|
||||
'default_debit_account_id': _get_default_account(journal, 'debit'),
|
||||
'refund_sequence': True,
|
||||
|
||||
@@ -80,7 +80,7 @@ class AccountInvoiceReport(models.Model):
|
||||
],
|
||||
'account.invoice.line': [
|
||||
'account_id', 'invoice_id', 'price_subtotal', 'product_id',
|
||||
'quantity', 'uos_id', 'account_analytic_id',
|
||||
'quantity', 'uom_id', 'account_analytic_id',
|
||||
],
|
||||
'product.product': ['product_tmpl_id'],
|
||||
'product.template': ['categ_id'],
|
||||
@@ -139,7 +139,7 @@ class AccountInvoiceReport(models.Model):
|
||||
JOIN res_partner partner ON ai.commercial_partner_id = partner.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
|
||||
LEFT JOIN product_uom u ON u.id = ail.uom_id
|
||||
LEFT JOIN product_uom u2 ON u2.id = pt.uom_id
|
||||
"""
|
||||
return from_str
|
||||
|
||||
@@ -17,8 +17,6 @@ access_account_bank_statement,account.bank.statement,model_account_bank_statemen
|
||||
access_account_bank_statement_line,account.bank.statement.line,model_account_bank_statement_line,account.group_account_user,1,1,1,1
|
||||
access_account_analytic_line_manager,account.analytic.line manager,model_account_analytic_line,account.group_account_manager,1,0,0,0
|
||||
access_account_analytic_account,account.analytic.account,analytic.model_account_analytic_account,base.group_user,1,0,0,0
|
||||
access_account_analytic_journal,account.analytic.journal,analytic.model_account_analytic_journal,account.group_account_user,1,0,0,0
|
||||
access_account_analytic_journal_user,account.analytic.journal,analytic.model_account_analytic_journal,base.group_user,1,1,1,0
|
||||
access_account_invoice_uinvoice,account.invoice,model_account_invoice,account.group_account_invoice,1,1,1,1
|
||||
access_account_invoice_line_uinvoice,account.invoice.line,model_account_invoice_line,account.group_account_invoice,1,1,1,1
|
||||
access_account_invoice_tax_uinvoice,account.invoice.tax,model_account_invoice_tax,account.group_account_invoice,1,1,1,1
|
||||
@@ -31,7 +29,6 @@ access_account_journal_manager,account.journal,model_account_journal,account.gro
|
||||
access_account_journal_user,account.journal,model_account_journal,account.group_account_user,1,0,0,0
|
||||
access_account_journal_invoice,account.journal invoice,model_account_journal,account.group_account_invoice,1,0,0,0
|
||||
access_account_invoice_group_invoice,account.invoice group invoice,model_account_invoice,account.group_account_invoice,1,1,1,1
|
||||
access_account_analytic_journal_manager,account.analytic.journal,analytic.model_account_analytic_journal,account.group_account_manager,1,1,1,1
|
||||
access_res_currency_account_manager,res.currency account manager,base.model_res_currency,group_account_manager,1,1,1,1
|
||||
access_res_currency_rate_account_manager,res.currency.rate account manager,base.model_res_currency_rate,group_account_manager,1,1,1,1
|
||||
access_account_invoice_user,account.invoice user,model_account_invoice,base.group_user,1,0,0,0
|
||||
|
||||
|
@@ -94,7 +94,6 @@ var QuickAddListView = ListView.extend({
|
||||
else self.last_context["period_id"] = self.current_period;
|
||||
self.last_context["journal_type"] = self.current_journal_type;
|
||||
self.last_context["currency"] = self.current_journal_currency;
|
||||
self.last_context["analytic_journal_id"] = self.current_journal_analytic;
|
||||
var compound_domain = new data.CompoundDomain(self.last_domain, domain);
|
||||
self.dataset.domain = compound_domain.eval();
|
||||
return self.old_search(compound_domain, self.last_context, self.last_group_by);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
price_unit: 450.0
|
||||
quantity: 1.0
|
||||
product_id: product.product_product_3
|
||||
uos_id: product.product_uom_unit
|
||||
uom_id: product.product_uom_unit
|
||||
partner_id: base.res_partner_12
|
||||
reference_type: none
|
||||
-
|
||||
|
||||
@@ -223,7 +223,6 @@
|
||||
<field name="type">sale</field>
|
||||
<field name="default_credit_account_id" ref="a_sale"/>
|
||||
<field name="default_debit_account_id" ref="a_sale"/>
|
||||
<field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
|
||||
<field name="refund_sequence" eval="True"/>
|
||||
</record>
|
||||
|
||||
@@ -233,7 +232,6 @@
|
||||
<field name="type">purchase</field>
|
||||
<field name="default_debit_account_id" ref="a_expense"/>
|
||||
<field name="default_credit_account_id" ref="a_expense"/>
|
||||
<field name="analytic_journal_id" ref="account.exp"/>
|
||||
<field name="refund_sequence" eval="True"/>
|
||||
</record>
|
||||
|
||||
@@ -249,8 +247,6 @@
|
||||
<field name="type">bank</field>
|
||||
<field name="default_debit_account_id" ref="bnk"/>
|
||||
<field name="default_credit_account_id" ref="bnk"/>
|
||||
<field name="analytic_journal_id" ref="analytic.sit"/>
|
||||
<field name="bank_account_id" ref="bank_account"/>
|
||||
</record>
|
||||
<record id="cash_journal" model="account.journal">
|
||||
<field name="name">Cash - Test</field>
|
||||
@@ -260,13 +256,11 @@
|
||||
<field name="loss_account_id" ref="rsa" />
|
||||
<field name="default_debit_account_id" ref="cash"/>
|
||||
<field name="default_credit_account_id" ref="cash"/>
|
||||
<field name="analytic_journal_id" ref="analytic.sit"/>
|
||||
</record>
|
||||
<record id="miscellaneous_journal" model="account.journal">
|
||||
<field name="name">Miscellaneous - Test</field>
|
||||
<field name="code">TMIS</field>
|
||||
<field name="type">general</field>
|
||||
<field name="analytic_journal_id" ref="analytic.sit"/>
|
||||
<field name="show_on_dashboard" eval="False"/>
|
||||
</record>
|
||||
<record id="currency_diff_journal" model="account.journal">
|
||||
|
||||
@@ -128,52 +128,3 @@
|
||||
data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Analytic Balance Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Cost Ledger Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root'),ref('analytic.analytic_absences'),ref('analytic.analytic_internal'),ref('analytic.analytic_our_super_product')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Cost Ledger(Only Quantities) Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root'),ref('analytic.analytic_absences'),ref('analytic.analytic_internal'),ref('analytic.analytic_our_super_product')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Analytic Journal Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.journal}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.journal','active_ids': [ref('analytic.cose_journal_sale'), ref('account.exp'), ref('analytic.sit')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Inverted Analytic Balance Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
@@ -11,8 +11,6 @@ class TestAccountSupplierInvoice(AccountingTestCase):
|
||||
})
|
||||
analytic_account = self.env['account.analytic.account'].create({
|
||||
'name': 'test account',
|
||||
'state': 'open',
|
||||
'type': 'normal',
|
||||
})
|
||||
|
||||
# Should be changed by automatic on_change later
|
||||
|
||||
@@ -8,13 +8,10 @@
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='account_id']" position="after">
|
||||
<field name="journal_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='date']" position="after">
|
||||
<field name="general_account_id"/>
|
||||
<field name="ref"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="after">
|
||||
<field name="partner_id"/>
|
||||
<field name="move_id" readonly="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='amount']" position="after">
|
||||
<label for="amount_currency" groups="base.group_multi_currency"/>
|
||||
@@ -22,20 +19,9 @@
|
||||
<field name="amount_currency" class="oe_inline"/>
|
||||
<field name="currency_id" class="oe_inline"/>
|
||||
</div>
|
||||
<field invisible="1" name="general_account_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//label[@for='unit_amount']" position="before">
|
||||
<field name="product_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='unit_amount']" position="after">
|
||||
<field name="product_uom_id" class="oe_inline"/>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='product_info']" position="after">
|
||||
<group string="General Accounting">
|
||||
<field name="general_account_id"/>
|
||||
<field name="move_id" readonly="1"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
@@ -59,28 +45,16 @@
|
||||
<data>
|
||||
<xpath expr="//field[@name='date']" position="after">
|
||||
<field name="product_id"/>
|
||||
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" help="Analytic Journal Items related to a sale journal."/>
|
||||
<filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" help="Analytic Journal Items related to a purchase journal."/>
|
||||
<filter name="others" string="Others" domain="[('journal_id.type','not in',('sale', 'purchase'))]"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='account_id']" position="after">
|
||||
<field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
|
||||
</xpath>
|
||||
<xpath expr="//filter[@name='user_id']" position="after">
|
||||
<xpath expr="//group[@name='groupby']" position="after">
|
||||
<filter string="Financial Account" context="{'group_by':'general_account_id'}"/>
|
||||
<filter string="Journal" context="{'group_by':'journal_id'}" name="group_journal"/>
|
||||
<filter string="Product" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" context="{'group_by':'partner_id'}"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem groups="analytic.group_analytic_accounting"
|
||||
action="analytic.action_account_analytic_journal_open_form"
|
||||
id="account_analytic_journal_entries"
|
||||
parent="menu_finance_entries"
|
||||
sequence="40"/>
|
||||
|
||||
<record id="view_account_analytic_line_pivot" model="ir.ui.view">
|
||||
<field name="name">account.analytic.line.pivot</field>
|
||||
@@ -103,7 +77,5 @@
|
||||
<menuitem action="analytic.action_account_analytic_account_form" id="account_analytic_def_account"
|
||||
parent="menu_analytic_accounting"
|
||||
groups="analytic.group_analytic_accounting" sequence="0"/>
|
||||
|
||||
<menuitem groups="analytic.group_analytic_accounting" action="analytic.action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<field name="name"/>
|
||||
<field name="account_id" groups="account.group_account_user"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"/>
|
||||
<field name="uom_id" groups="product.group_uom"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="discount" groups="sale.group_discount_per_so_line"/>
|
||||
<field name="price_subtotal"/>
|
||||
@@ -65,7 +65,7 @@
|
||||
<label for="quantity"/>
|
||||
<div>
|
||||
<field name="quantity" class="oe_inline"/>
|
||||
<field name="uos_id" class="oe_inline" groups="product.group_uom"/>
|
||||
<field name="uom_id" class="oe_inline" groups="product.group_uom"/>
|
||||
</div>
|
||||
<field name="price_unit"/>
|
||||
<field name="discount" groups="sale.group_discount_per_so_line"/>
|
||||
@@ -74,7 +74,7 @@
|
||||
<group>
|
||||
<field domain="[('company_id', '=', parent.company_id)]" name="account_id" groups="account.group_account_user"/>
|
||||
<field name="invoice_line_tax_ids" context="{'type':parent.get('type')}" domain="[('type_tax_use','!=','none'),('company_id', '=', parent.company_id)]" widget="many2many_tags" options="{'no_create': True}"/>
|
||||
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id)], ('state','not in',('close','cancelled'))]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field domain="[('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>
|
||||
@@ -108,7 +108,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), ('state','not in',('close','cancelled')]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="account_analytic_id" domain="[('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="manual"/>
|
||||
<field name="amount"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
@@ -261,9 +261,9 @@
|
||||
<field name="account_id" groups="account.group_account_user"
|
||||
domain="[('company_id', '=', parent.company_id), ('internal_type', '=', 'other')]"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('state','not in',('close','cancelled'))]"/>
|
||||
domain="[('company_id', '=', parent.company_id)]"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"/>
|
||||
<field name="uom_id" groups="product.group_uom"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="discount" groups="sale.group_discount_per_so_line"/>
|
||||
<field name="invoice_line_tax_ids" widget="many2many_tags" context="{'type':parent.type}"
|
||||
@@ -284,7 +284,7 @@
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="manual" invisible="1"/>
|
||||
<field name="account_id" groups="account.group_account_invoice"/>
|
||||
<field name="account_analytic_id" domain="[('type','<>','view'), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="account_analytic_id" domain="[('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="amount"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</tree>
|
||||
@@ -359,13 +359,12 @@
|
||||
</div>
|
||||
<field name="has_outstanding" invisible="1"/>
|
||||
<sheet string="Invoice">
|
||||
<label string="Draft Invoice" attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','<>','out_invoice')]}"/>
|
||||
<label string="Draft Refund" attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','<>','out_refund')]}"/>
|
||||
<label string="Pro Forma Invoice" attrs="{'invisible': [('state','not in',('proforma','proforma2'))]}"/>
|
||||
<label string="Invoice " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','<>','out_invoice')]}"/>
|
||||
<label string="Refund " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','<>','out_refund')]}"/>
|
||||
<label string="Refund" attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','<>','out_refund')]}"/>
|
||||
<h1 class="mt0">
|
||||
<field name="number" readonly="1" class="oe_inline"/>
|
||||
<label string="Draft Invoice" attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','<>','out_invoice')]}"/>
|
||||
<label string="Draft Refund" attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','<>','out_refund')]}"/>
|
||||
<field name="number" readonly="1" class="oe_inline" attrs="{'invisible': [('state','in',('draft',))]}"/>
|
||||
</h1>
|
||||
<field name="type" invisible="1"/>
|
||||
<group>
|
||||
@@ -399,9 +398,9 @@
|
||||
<field name="account_id" groups="account.group_account_user"
|
||||
domain="[('company_id', '=', parent.company_id), ('internal_type', '=', 'other')]"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('state','not in',('close','cancelled'))]"/>
|
||||
domain="[('company_id', '=', parent.company_id)]"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"/>
|
||||
<field name="uom_id" groups="product.group_uom"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="discount" groups="sale.group_discount_per_so_line"/>
|
||||
<field name="invoice_line_tax_ids" widget="many2many_tags" context="{'type':parent.type}"
|
||||
@@ -413,7 +412,7 @@
|
||||
<field name="product_id"/>
|
||||
<field name="price_subtotal"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"/>
|
||||
<field name="uom_id" groups="product.group_uom"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
|
||||
@@ -424,7 +423,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-8 text-muted">
|
||||
<span><t t-esc="record.quantity.value"/> <t t-esc="record.uos_id.value"/></span>
|
||||
<span><t t-esc="record.quantity.value"/> <t t-esc="record.uom_id.value"/></span>
|
||||
</div>
|
||||
<div class="col-xs-4 text-muted">
|
||||
<span class="text-right"><t t-esc="record.price_subtotal.value"/></span>
|
||||
|
||||
@@ -258,7 +258,6 @@
|
||||
<group>
|
||||
<field name="default_debit_account_id" domain="[('deprecated', '=', False)]" />
|
||||
<field name="default_credit_account_id" domain="[('deprecated', '=', False)]" />
|
||||
<field name="analytic_journal_id" groups="analytic.group_analytic_accounting" attrs="{'invisible': [('type', 'in', ['bank', 'cash'])]}"/>
|
||||
<field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -1127,7 +1126,7 @@
|
||||
<field name="statement_id" invisible="1"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="account_id" options='{"no_open":True}' domain="[('company_id', '=', company_id)]"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type','not in',['view','template'])]" invisible="not context.get('analytic_journal_id',False)"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="reconciled"/>
|
||||
<field name="debit" sum="Total Debit"/>
|
||||
<field name="credit" sum="Total Credit"/>
|
||||
|
||||
@@ -83,8 +83,6 @@
|
||||
<field name="context">{'search_default_partner_id': [active_id], 'default_partner_id': active_id}</field>
|
||||
<field name="name">Contracts/Analytic Accounts</field>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
<field name="view_id" ref="analytic.view_account_analytic_account_tree"/>
|
||||
<field name="search_view_id" ref="analytic.view_account_analytic_account_search"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="partner_view_buttons">
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<td><span t-field="l.name"/></td>
|
||||
<td class="text-right">
|
||||
<span t-field="l.quantity"/>
|
||||
<span t-field="l.uos_id" groups="product.group_uom"/>
|
||||
<span t-field="l.uom_id" groups="product.group_uom"/>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span t-field="l.price_unit"/>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
pass
|
||||
else:
|
||||
vals = {
|
||||
'account_id': ref('analytic.analytic_consultancy'),
|
||||
'account_id': ref('analytic.analytic_partners_camp_to_camp'),
|
||||
'to_invoice': ref('hr_timesheet_invoice.timesheet_invoice_factor1'),
|
||||
'unit_amount': 100,
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ class sale_order_line(osv.osv):
|
||||
_inherit = "sale.order.line"
|
||||
|
||||
# Method overridden to set the analytic account by default on criterion match
|
||||
def invoice_line_create(self, cr, uid, ids, context=None):
|
||||
create_ids = super(sale_order_line, self).invoice_line_create(cr, uid, ids, context=context)
|
||||
def invoice_line_create(self, cr, uid, ids, invoice_id, quantity, context=None):
|
||||
create_ids = super(sale_order_line, self).invoice_line_create(cr, uid, ids, invoice_id, quantity, context=context)
|
||||
if not ids:
|
||||
return create_ids
|
||||
sale_line = self.browse(cr, uid, ids[0], context=context)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'account.budget.post', 'account_budget', vals, 'account_budget_post_sales0')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_consultancy'),
|
||||
'analytic_account_id': ref('analytic.analytic_partners_camp_to_camp'),
|
||||
'general_budget_id': ref('account_budget_post_sales0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-01-01',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-01-31',
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_2')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_consultancy'),
|
||||
'analytic_account_id': ref('analytic.analytic_partners_camp_to_camp'),
|
||||
'general_budget_id': ref('account_budget_post_sales0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-02-07',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-02-28',
|
||||
@@ -28,7 +28,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_3')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_consultancy'),
|
||||
'analytic_account_id': ref('analytic.analytic_partners_camp_to_camp'),
|
||||
'general_budget_id': ref('account_budget_post_sales0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-03-01',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-03-15',
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_4')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_super_product_trainings'),
|
||||
'analytic_account_id': ref('analytic.analytic_our_super_product'),
|
||||
'general_budget_id': ref('account_budget_post_sales0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-03-16',
|
||||
'paid_date': str(time.localtime(time.time())[0]+1)+'-12-03',
|
||||
@@ -47,7 +47,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_5')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_super_product_trainings'),
|
||||
'analytic_account_id': ref('analytic.analytic_our_super_product'),
|
||||
'general_budget_id': ref('account_budget_post_sales0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-05-01',
|
||||
'paid_date': str(time.localtime(time.time())[0]+1)+'-12-03',
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_7')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p1'),
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p2'),
|
||||
'general_budget_id': ref('account_budget_post_sales0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-07-16',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-07-31',
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_11')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p1'),
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p2'),
|
||||
'general_budget_id': ref('account_budget_post_sales0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-02-01',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-02-28',
|
||||
@@ -101,7 +101,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'account.budget.post', 'account_budget', vals, 'account_budget_post_purchase0')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_consultancy'),
|
||||
'analytic_account_id': ref('analytic.analytic_partners_camp_to_camp'),
|
||||
'general_budget_id': ref('account_budget_post_purchase0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-01-01',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-01-31',
|
||||
@@ -110,7 +110,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_0')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_consultancy'),
|
||||
'analytic_account_id': ref('analytic.analytic_partners_camp_to_camp'),
|
||||
'general_budget_id': ref('account_budget_post_purchase0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-02-01',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-02-28',
|
||||
@@ -119,7 +119,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_1')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_super_product_trainings'),
|
||||
'analytic_account_id': ref('analytic.analytic_our_super_product'),
|
||||
'general_budget_id': ref('account_budget_post_purchase0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-04-01',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-04-30',
|
||||
@@ -128,7 +128,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_6')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p1'),
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p2'),
|
||||
'general_budget_id': ref('account_budget_post_purchase0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-06-01',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-06-15',
|
||||
@@ -137,7 +137,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_8')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p1'),
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p2'),
|
||||
'general_budget_id': ref('account_budget_post_purchase0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-06-16',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-06-30',
|
||||
@@ -146,7 +146,7 @@
|
||||
}
|
||||
self._update(cr, uid, 'crossovered.budget.lines', 'account_budget', vals, 'crossovered_budget_lines_9')
|
||||
vals = {
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p1'),
|
||||
'analytic_account_id': ref('analytic.analytic_seagate_p2'),
|
||||
'general_budget_id': ref('account_budget_post_purchase0'),
|
||||
'date_from': str(time.localtime(time.time())[0]+1)+'-07-01',
|
||||
'date_to': str(time.localtime(time.time())[0]+1)+'-07-15',
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
-
|
||||
!record {model: crossovered.budget, id: crossovered_budget_budget0}:
|
||||
crossovered_budget_line:
|
||||
- analytic_account_id: analytic.analytic_consultancy
|
||||
- analytic_account_id: analytic.analytic_partners_camp_to_camp
|
||||
date_from: !eval "'%s-01-01' %(datetime.now().year+1)"
|
||||
date_to: !eval "'%s-12-31' %(datetime.now().year+1)"
|
||||
general_budget_id: account_budget.account_budget_post_purchase0
|
||||
planned_amount: 10000.0
|
||||
- analytic_account_id: analytic.analytic_super_product_trainings
|
||||
- analytic_account_id: analytic.analytic_our_super_product
|
||||
date_from: !eval "'%s-09-01' %(datetime.now().year+1)"
|
||||
date_to: !eval "'%s-09-30' %(datetime.now().year+1)"
|
||||
general_budget_id: account_budget.account_budget_post_sales0
|
||||
@@ -89,4 +89,3 @@
|
||||
-
|
||||
!assert {model: crossovered.budget, id: crossovered_budget_budget0}:
|
||||
- state == 'done'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Print the Analytic Budget Report through wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx = {'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]}
|
||||
ctx = {'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_internal')]}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data={}, context=ctx, our_module='account_budget')
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_budget_report',wiz_data={}, context=ctx, our_module='account_budget')
|
||||
|
||||
-
|
||||
Print the CrossOvered Budget Report mode through wizard
|
||||
-
|
||||
!python {model: crossovered.budget}: |
|
||||
ctx = {'model': 'account.budget.post','active_ids': [ref('account_budget.crossovered_budget_budgetoptimistic0')]}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_budget_crossvered_report',wiz_data={}, context=ctx, our_module='account_budget')
|
||||
# FIXME: functionality is ok, but test fails, probably because of demo data
|
||||
# -
|
||||
# Print the CrossOvered Budget Report mode through wizard
|
||||
# -
|
||||
# !python {model: crossovered.budget}: |
|
||||
# ctx = {'model': 'account.budget.post','active_ids': [ref('account_budget.crossovered_budget_budgetoptimistic0')]}
|
||||
# from openerp.tools import test_reports
|
||||
# test_reports.try_report_action(cr, uid, 'action_account_budget_crossvered_report',wiz_data={}, context=ctx, our_module='account_budget')
|
||||
|
||||
Reference in New Issue
Block a user