[MERGE] merged the xrg branch containing several bugfixes
authorqdp-launchpad@tinyerp.com <>
Thu, 30 Dec 2010 11:53:09 +0000 (12:53 +0100)
committerqdp-launchpad@tinyerp.com <>
Thu, 30 Dec 2010 11:53:09 +0000 (12:53 +0100)
bzr revid: qdp-launchpad@tinyerp.com-20101230115309-drnbznu04hx52cbj

1  2 
addons/account/report/account_general_ledger.rml
addons/account/report/account_general_ledger_landscape.rml
addons/account/report/account_partner_balance.py
addons/account_voucher/account_voucher.py
addons/hr_payroll_account/hr_payroll_account.py
addons/purchase/report/purchase_report.py
addons/sale/report/sale_report.py

              <para style="terp_default_Bold_9_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
            </td>
            <td>
-             <para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</para>
 -            <para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.name or '' ]]</para>
++            <para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]]</para>
            </td>
          </tr>
        </blockTable>
      </section>
      </pto>
    </story>
--</document>
++</document>
        <blockTable rowHeights="0.55cm" colWidths="490.0,65.0,65.0,75.0,75.0" style="Table8">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
          <tr>
            <td>
 -            <para style="terp_default_Bold_8"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
 +            <para style="terp_default_Bold_7"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
            </td>
            <td>
 -            <para style="terp_default_Bold_8_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
 +            <para style="terp_default_Bold_7_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
            </td>
            <td>
 -            <para style="terp_default_Bold_8_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
 +            <para style="terp_default_Bold_7_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
            </td>
            <td>
 -            <para style="terp_default_Bold_8_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
 +            <para style="terp_default_Bold_7_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
            </td>
            <td>
-             <para style="terp_default_Bold_7_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</para>
 -            <para style="terp_default_Bold_8_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.name or '' ]]</para>
++            <para style="terp_default_Bold_7_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]]</para>
            </td>
          </tr>
        </blockTable>
@@@ -276,6 -274,7 +274,7 @@@ class partner_balance(report_sxw.rml_pa
          return temp_res
  
      def _sum_litige(self):
 -        # TODO docstring, explain me!
++        #gives the total of move lines with blocked boolean set to TRUE for the report selection
          move_state = ['draft','posted']
          if self.target_move == 'posted':
              move_state = ['posted']
@@@ -89,21 -90,17 +89,21 @@@ class sale_report(osv.osv)
                  sale_order s,
                      (
                      select l.id as id,
 -                         l.product_id as product_id,
 -                         u.name as uom_name,
 -                         sum(l.product_uom_qty * u.factor) as product_uom_qty,
 -                         sum(l.product_uom_qty*l.price_unit) as price_total,
 -                         (sum(l.product_uom_qty*l.price_unit)/sum(nullif(l.product_uom_qty * u.factor,0))*count(l.product_id))::decimal(16,2) as price_average,
 -                         pt.categ_id, l.order_id
 +                        l.product_id as product_id,
 +                        (case when u.uom_type not in ('reference') then
 +                            (select name from product_uom where uom_type='reference' and category_id=u.category_id)
 +                        else
 +                            u.name
 +                        end) as uom_name,
-                         sum(l.product_uom_qty/u.factor) as product_uom_qty,
-                         sum(l.product_uom_qty*l.price_unit) as price_total,
++                        sum(l.product_uom_qty * u.factor) as product_uom_qty,
++                        sum(l.product_uom_qty * l.price_unit) as price_total,
 +                        pt.categ_id, l.order_id
                      from
 -                     sale_order_line l
 -                     left join product_uom u on (u.id=l.product_uom)
 -                     left join product_template pt on (pt.id=l.product_id)
 -                    group by l.id, l.order_id, l.product_id, u.name, pt.categ_id) el
 +                     sale_order_line l ,product_uom u, product_product p, product_template pt
 +                     where u.id = l.product_uom
 +                     and pt.id = p.product_tmpl_id
 +                     and p.id = l.product_id
 +                      group by l.id, l.order_id, l.product_id, u.name, pt.categ_id, u.uom_type, u.category_id) el
                  where s.id = el.order_id
                  group by el.id,
                      el.product_id,