c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #02167
[Bug 588632] Re: c2c_budget: budget v. real inconsitent sums and printing sequence
Hello Ferdinand,
Our R&D Teams are currently focused on the latest OpenERP version, and
unfortunately this issue does not affect it..
Thanks.
** Changed in: openobject-addons
Status: New => Won't Fix
--
c2c_budget: budget v. real inconsitent sums and printing sequence
https://bugs.launchpad.net/bugs/588632
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
Status in OpenObject Addons Modules: Won't Fix
Bug description:
budget items are printed using the sequences, sums are calculated using parent child relation - hence a good chance that printed sums are nor the sums of the items.
IMHO changing a parent must automatically reorder the sequences of - better - the report should use the parent child relation as FIRST sort criteria and sequence as second.
this postgres functions creates usable sequence numbers
create or replace function c2c_budget_sequence()
RETURNS void AS $$
DECLARE
level_p integer;
id_p integer;
parent_id_p integer;
r record;
o record;
BEGIN
update c2c_budget_item set sequence = 0;
-- postgres tablefunc.sql must be loaded
create table c2c_budget_item_sequence as
SELECT * FROM connectby('c2c_budget_item','id','parent_id', 'name', '1111', 0, '~')
AS t(keyid integer, parent_keyid integer, level int, branch text, pos int);
update c2c_budget_item i
set sequence = ( select pos from c2c_budget_item_sequence where keyid = i.id);
drop table c2c_budget_item_sequence;
RETURN ;
END;
$$ LANGUAGE plpgsql;
select c2c_budget_sequence();