Browse Source

Global review, fix and make missing fields translatable

pull/211/head
jcoux 8 years ago
parent
commit
65d5306316
  1. 18
      account_financial_report_qweb/report/aged_partner_balance.py
  2. 4
      account_financial_report_qweb/report/general_ledger.py
  3. 2
      account_financial_report_qweb/report/open_items.py
  4. 10
      account_financial_report_qweb/report/trial_balance.py
  5. 3
      account_financial_report_qweb/wizard/aged_partner_balance_wizard.py
  6. 24
      account_financial_report_qweb/wizard/aged_partner_balance_wizard_view.xml
  7. 9
      account_financial_report_qweb/wizard/general_ledger_wizard.py
  8. 26
      account_financial_report_qweb/wizard/general_ledger_wizard_view.xml
  9. 3
      account_financial_report_qweb/wizard/open_items_wizard.py
  10. 24
      account_financial_report_qweb/wizard/open_items_wizard_view.xml
  11. 9
      account_financial_report_qweb/wizard/trial_balance_wizard.py
  12. 24
      account_financial_report_qweb/wizard/trial_balance_wizard_view.xml

18
account_financial_report_qweb/report/aged_partner_balance.py

@ -11,10 +11,10 @@ class AgedPartnerBalanceReport(models.TransientModel):
The class hierarchy is : The class hierarchy is :
* AgedPartnerBalanceReport * AgedPartnerBalanceReport
** AgedPartnerBalanceAccount
*** AgedPartnerBalancePartner
**** AgedPartnerBalanceLine
**** AgedPartnerBalanceMoveLine
** AgedPartnerBalanceReportAccount
*** AgedPartnerBalanceReportPartner
**** AgedPartnerBalanceReportLine
**** AgedPartnerBalanceReportMoveLine
If "show_move_line_details" is selected If "show_move_line_details" is selected
""" """
@ -38,7 +38,7 @@ class AgedPartnerBalanceReport(models.TransientModel):
) )
class AgedPartnerBalanceAccount(models.TransientModel):
class AgedPartnerBalanceReportAccount(models.TransientModel):
_name = 'report_aged_partner_balance_qweb_account' _name = 'report_aged_partner_balance_qweb_account'
_order = 'code ASC' _order = 'code ASC'
@ -81,7 +81,7 @@ class AgedPartnerBalanceAccount(models.TransientModel):
) )
class AgedPartnerBalancePartner(models.TransientModel):
class AgedPartnerBalanceReportPartner(models.TransientModel):
_name = 'report_aged_partner_balance_qweb_partner' _name = 'report_aged_partner_balance_qweb_partner'
@ -125,7 +125,7 @@ ORDER BY
""" """
class AgedPartnerBalanceLine(models.TransientModel):
class AgedPartnerBalanceReportLine(models.TransientModel):
_name = 'report_aged_partner_balance_qweb_line' _name = 'report_aged_partner_balance_qweb_line'
@ -146,7 +146,7 @@ class AgedPartnerBalanceLine(models.TransientModel):
older = fields.Float(digits=(16, 2)) older = fields.Float(digits=(16, 2))
class AgedPartnerBalanceMoveLine(models.TransientModel):
class AgedPartnerBalanceReportMoveLine(models.TransientModel):
_name = 'report_aged_partner_balance_qweb_move_line' _name = 'report_aged_partner_balance_qweb_move_line'
@ -222,6 +222,8 @@ class AgedPartnerBalanceReportCompute(models.TransientModel):
self._inject_move_line_values() self._inject_move_line_values()
self._inject_move_line_values(only_empty_partner_line=True) self._inject_move_line_values(only_empty_partner_line=True)
self._compute_accounts_cumul() self._compute_accounts_cumul()
# Refresh cache because all data are computed with SQL requests
self.refresh()
def _inject_account_values(self): def _inject_account_values(self):
"""Inject report values for report_aged_partner_balance_qweb_account""" """Inject report values for report_aged_partner_balance_qweb_account"""

4
account_financial_report_qweb/report/general_ledger.py

@ -208,6 +208,8 @@ class GeneralLedgerReportCompute(models.TransientModel):
self._inject_line_centralized_values() self._inject_line_centralized_values()
# Compute display flag # Compute display flag
self._compute_has_second_currency() self._compute_has_second_currency()
# Refresh cache because all data are computed with SQL requests
self.refresh()
def _inject_account_values(self): def _inject_account_values(self):
"""Inject report values for report_general_ledger_qweb_account.""" """Inject report values for report_general_ledger_qweb_account."""
@ -896,7 +898,7 @@ SELECT
NOW() AS create_date, NOW() AS create_date,
ml.date, ml.date,
a.code AS account, a.code AS account,
'Centralized Entries' AS label,
'""" + _('Centralized Entries') + """' AS label,
ml.debit AS debit, ml.debit AS debit,
ml.credit AS credit, ml.credit AS credit,
ra.initial_balance + ( ra.initial_balance + (

2
account_financial_report_qweb/report/open_items.py

@ -169,6 +169,8 @@ class OpenItemsReportCompute(models.TransientModel):
) )
# Compute display flag # Compute display flag
self._compute_has_second_currency() self._compute_has_second_currency()
# Refresh cache because all data are computed with SQL requests
self.refresh()
def _inject_account_values(self): def _inject_account_values(self):
"""Inject report values for report_open_items_qweb_account.""" """Inject report values for report_open_items_qweb_account."""

10
account_financial_report_qweb/report/trial_balance.py

@ -11,8 +11,8 @@ class TrialBalanceReport(models.TransientModel):
The class hierarchy is : The class hierarchy is :
* TrialBalanceReport * TrialBalanceReport
** TrialBalanceAccount
*** TrialBalancePartner
** TrialBalanceReportAccount
*** TrialBalanceReportPartner
If "show_partner_details" is selected If "show_partner_details" is selected
""" """
@ -42,7 +42,7 @@ class TrialBalanceReport(models.TransientModel):
) )
class TrialBalanceAccount(models.TransientModel):
class TrialBalanceReportAccount(models.TransientModel):
_name = 'report_trial_balance_qweb_account' _name = 'report_trial_balance_qweb_account'
_order = 'code ASC' _order = 'code ASC'
@ -75,7 +75,7 @@ class TrialBalanceAccount(models.TransientModel):
) )
class TrialPartnerAccount(models.TransientModel):
class TrialBalanceReportPartner(models.TransientModel):
_name = 'report_trial_balance_qweb_partner' _name = 'report_trial_balance_qweb_partner'
@ -156,6 +156,8 @@ class TrialBalanceReportCompute(models.TransientModel):
self._inject_account_values() self._inject_account_values()
if self.show_partner_details: if self.show_partner_details:
self._inject_partner_values() self._inject_partner_values()
# Refresh cache because all data are computed with SQL requests
self.refresh()
def _inject_account_values(self): def _inject_account_values(self):
"""Inject report values for report_trial_balance_qweb_account""" """Inject report values for report_trial_balance_qweb_account"""

3
account_financial_report_qweb/wizard/aged_partner_balance_wizard.py

@ -16,7 +16,8 @@ class AgedPartnerBalance(models.TransientModel):
company_id = fields.Many2one( company_id = fields.Many2one(
comodel_name='res.company', comodel_name='res.company',
default=lambda self: self.env.user.company_id
default=lambda self: self.env.user.company_id,
string='Company'
) )
date_at = fields.Date(required=True, date_at = fields.Date(required=True,
default=fields.Date.to_string(datetime.today())) default=fields.Date.to_string(datetime.today()))

24
account_financial_report_qweb/wizard/aged_partner_balance_wizard_view.xml

@ -8,10 +8,10 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<group name="main_info"> <group name="main_info">
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
</group> </group>
<group name="filters"> <group name="filters">
<group name="date_ranger">
<group name="date_range">
<field name="date_at"/> <field name="date_at"/>
</group> </group>
<group name="other_filters"> <group name="other_filters">
@ -20,14 +20,14 @@
</group> </group>
</group> </group>
<label for="partner_ids"/> <label for="partner_ids"/>
<field name="partner_ids" nolabel="1"/>
<field name="partner_ids" nolabel="1" options="{'no_create': True}"/>
<group/> <group/>
<label for="account_ids"/> <label for="account_ids"/>
<group col="4"> <group col="4">
<field name="receivable_accounts_only"/> <field name="receivable_accounts_only"/>
<field name="payable_accounts_only"/> <field name="payable_accounts_only"/>
</group> </group>
<field name="account_ids" nolabel="1"/>
<field name="account_ids" nolabel="1" options="{'no_create': True}"/>
<footer> <footer>
<button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/> <button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/>
or or
@ -39,14 +39,12 @@
</field> </field>
</record> </record>
<record id="action_aged_partner_balance_wizard" model="ir.actions.act_window">
<field name="name">Aged Partner Balance</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">aged.partner.balance.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="aged_partner_balance_wizard"/>
<field name="target">new</field>
</record>
<act_window id="action_aged_partner_balance_wizard"
name="Aged Partner Balance"
res_model="aged.partner.balance.wizard"
view_type="form"
view_mode="form"
view_id="aged_partner_balance_wizard"
target="new" />
</odoo> </odoo>

9
account_financial_report_qweb/wizard/general_ledger_wizard.py

@ -15,9 +15,14 @@ class GeneralLedgerReportWizard(models.TransientModel):
company_id = fields.Many2one( company_id = fields.Many2one(
comodel_name='res.company', comodel_name='res.company',
default=lambda self: self.env.user.company_id
default=lambda self: self.env.user.company_id,
string='Company'
)
date_range_id = fields.Many2one(
comodel_name='date.range',
required=True,
string='Date range'
) )
date_range_id = fields.Many2one(comodel_name='date.range', required=True)
date_from = fields.Date(required=True) date_from = fields.Date(required=True)
date_to = fields.Date(required=True) date_to = fields.Date(required=True)
fy_start_date = fields.Date(required=True) fy_start_date = fields.Date(required=True)

26
account_financial_report_qweb/wizard/general_ledger_wizard_view.xml

@ -8,10 +8,10 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<group name="main_info"> <group name="main_info">
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
</group> </group>
<group name="filters"> <group name="filters">
<group name="date_ranger">
<group name="date_range">
<field name="date_range_id" domain="[('company_id','=',company_id)]"/> <field name="date_range_id" domain="[('company_id','=',company_id)]"/>
<field name="date_from"/> <field name="date_from"/>
<field name="date_to"/> <field name="date_to"/>
@ -24,17 +24,17 @@
</group> </group>
</group> </group>
<label for="cost_center_ids" groups="analytic.group_analytic_accounting"/> <label for="cost_center_ids" groups="analytic.group_analytic_accounting"/>
<field name="cost_center_ids" nolabel="1" groups="analytic.group_analytic_accounting"/>
<field name="cost_center_ids" nolabel="1" options="{'no_create': True}" groups="analytic.group_analytic_accounting"/>
<group/> <group/>
<label for="partner_ids"/> <label for="partner_ids"/>
<field name="partner_ids" nolabel="1"/>
<field name="partner_ids" nolabel="1" options="{'no_create': True}"/>
<group/> <group/>
<label for="account_ids"/> <label for="account_ids"/>
<group col="4"> <group col="4">
<field name="receivable_accounts_only"/> <field name="receivable_accounts_only"/>
<field name="payable_accounts_only"/> <field name="payable_accounts_only"/>
</group> </group>
<field name="account_ids" nolabel="1"/>
<field name="account_ids" nolabel="1" options="{'no_create': True}"/>
<footer> <footer>
<button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/> <button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/>
or or
@ -46,14 +46,12 @@
</field> </field>
</record> </record>
<record id="action_general_ledger_wizard" model="ir.actions.act_window">
<field name="name">General Ledger</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">general.ledger.report.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="general_ledger_wizard"/>
<field name="target">new</field>
</record>
<act_window id="action_general_ledger_wizard"
name="General Ledger"
res_model="general.ledger.report.wizard"
view_type="form"
view_mode="form"
view_id="general_ledger_wizard"
target="new" />
</odoo> </odoo>

3
account_financial_report_qweb/wizard/open_items_wizard.py

@ -16,7 +16,8 @@ class OpenItemsReportWizard(models.TransientModel):
company_id = fields.Many2one( company_id = fields.Many2one(
comodel_name='res.company', comodel_name='res.company',
default=lambda self: self.env.user.company_id
default=lambda self: self.env.user.company_id,
string='Company'
) )
date_at = fields.Date(required=True, date_at = fields.Date(required=True,
default=fields.Date.to_string(datetime.today())) default=fields.Date.to_string(datetime.today()))

24
account_financial_report_qweb/wizard/open_items_wizard_view.xml

@ -8,10 +8,10 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<group name="main_info"> <group name="main_info">
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
</group> </group>
<group name="filters"> <group name="filters">
<group name="date_ranger">
<group name="date_range">
<field name="date_at"/> <field name="date_at"/>
</group> </group>
<group name="other_filters"> <group name="other_filters">
@ -20,14 +20,14 @@
</group> </group>
</group> </group>
<label for="partner_ids"/> <label for="partner_ids"/>
<field name="partner_ids" nolabel="1"/>
<field name="partner_ids" nolabel="1" options="{'no_create': True}"/>
<group/> <group/>
<label for="account_ids"/> <label for="account_ids"/>
<group col="4"> <group col="4">
<field name="receivable_accounts_only"/> <field name="receivable_accounts_only"/>
<field name="payable_accounts_only"/> <field name="payable_accounts_only"/>
</group> </group>
<field name="account_ids" nolabel="1"/>
<field name="account_ids" nolabel="1" options="{'no_create': True}"/>
<footer> <footer>
<button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/> <button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/>
or or
@ -39,14 +39,12 @@
</field> </field>
</record> </record>
<record id="action_open_items_wizard" model="ir.actions.act_window">
<field name="name">Open Items</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">open.items.report.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="open_items_wizard"/>
<field name="target">new</field>
</record>
<act_window id="action_open_items_wizard"
name="Open Items"
res_model="open.items.report.wizard"
view_type="form"
view_mode="form"
view_id="open_items_wizard"
target="new" />
</odoo> </odoo>

9
account_financial_report_qweb/wizard/trial_balance_wizard.py

@ -14,9 +14,14 @@ class TrialBalanceReportWizard(models.TransientModel):
company_id = fields.Many2one( company_id = fields.Many2one(
comodel_name='res.company', comodel_name='res.company',
default=lambda self: self.env.user.company_id
default=lambda self: self.env.user.company_id,
string='Company'
)
date_range_id = fields.Many2one(
comodel_name='date.range',
required=True,
string='Date range'
) )
date_range_id = fields.Many2one(comodel_name='date.range', required=True)
date_from = fields.Date(required=True) date_from = fields.Date(required=True)
date_to = fields.Date(required=True) date_to = fields.Date(required=True)
fy_start_date = fields.Date(required=True) fy_start_date = fields.Date(required=True)

24
account_financial_report_qweb/wizard/trial_balance_wizard_view.xml

@ -8,10 +8,10 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<group name="main_info"> <group name="main_info">
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
</group> </group>
<group name="filters"> <group name="filters">
<group name="date_ranger">
<group name="date_range">
<field name="date_range_id" domain="[('company_id','=',company_id)]"/> <field name="date_range_id" domain="[('company_id','=',company_id)]"/>
<field name="date_from"/> <field name="date_from"/>
<field name="date_to"/> <field name="date_to"/>
@ -24,14 +24,14 @@
</group> </group>
</group> </group>
<label for="partner_ids" attrs="{'invisible':[('show_partner_details','!=',True)]}"/> <label for="partner_ids" attrs="{'invisible':[('show_partner_details','!=',True)]}"/>
<field name="partner_ids" nolabel="1" attrs="{'invisible':[('show_partner_details','!=',True)]}"/>
<field name="partner_ids" nolabel="1" options="{'no_create': True}" attrs="{'invisible':[('show_partner_details','!=',True)]}"/>
<group attrs="{'invisible':[('show_partner_details','!=',True)]}"/> <group attrs="{'invisible':[('show_partner_details','!=',True)]}"/>
<label for="account_ids"/> <label for="account_ids"/>
<group col="4"> <group col="4">
<field name="receivable_accounts_only"/> <field name="receivable_accounts_only"/>
<field name="payable_accounts_only"/> <field name="payable_accounts_only"/>
</group> </group>
<field name="account_ids" nolabel="1"/>
<field name="account_ids" nolabel="1" options="{'no_create': True}"/>
<footer> <footer>
<button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/> <button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/>
or or
@ -43,14 +43,12 @@
</field> </field>
</record> </record>
<record id="action_trial_balance_wizard" model="ir.actions.act_window">
<field name="name">Trial Balance</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">trial.balance.report.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="trial_balance_wizard"/>
<field name="target">new</field>
</record>
<act_window id="action_trial_balance_wizard"
name="Trial Balance"
res_model="trial.balance.report.wizard"
view_type="form"
view_mode="form"
view_id="trial_balance_wizard"
target="new" />
</odoo> </odoo>
Loading…
Cancel
Save