account_fiscal_position should have a foreing rules to cancel removal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Confirmed
|
Low
|
Akretion Team |
Bug Description
Dear all,
This is OpenERP 6.03 with French accounting rules.
While working on a new fiscal rule, I was able to delete an important rule,
which is for applying taxes in the European Union.
I had nearly a heart attack!
Fortunately, I had a PostgreSQL backup and could access the table structure using pgAdmin3.
This is table account_
Then I discovered that the taxes registered in the fiscal rule had been removed also.
At PostgreSQL level, there should be a foreign rule to cancel removing a fiscal rule when it contains taxes.
The table definition is:
CREATE TABLE account_
(
id serial NOT NULL,
create_uid integer,
create_date timestamp without time zone,
write_date timestamp without time zone,
write_uid integer,
position_id integer NOT NULL, -- Fiscal Position
account_dest_id integer NOT NULL, -- Account Destination
account_src_id integer NOT NULL, -- Account Source
CONSTRAINT account_
CONSTRAINT account_
REFERENCES account_account (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE SET NULL,
CONSTRAINT account_
REFERENCES account_account (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE SET NULL,
CONSTRAINT account_
REFERENCES res_users (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE SET NULL,
CONSTRAINT account_
REFERENCES account_
ON UPDATE NO ACTION ON DELETE CASCADE,
CONSTRAINT account_
REFERENCES res_users (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE SET NULL
)
WITH (
OIDS=FALSE
);
I don't know OpenERP very well, but I guess it there should be an additional check to cancel any accidental removal.
A fiscal rule with taxes ... should never be removed. A user should remove taxes one by one and then remove the fiscal rule.
This way, there is little chance for accidental removal.
Also, just for information, I had used this rule in 100s of entries.
So maybe removing a fiscal rule being used ... should not be allowed in any cases, as it breaks the information system.
Changed in openobject-addons: | |
assignee: | nobody → Akretion Team (akretion-team) |
importance: | Undecided → Low |
status: | New → Confirmed |
Looks like a trivial change, any progress ?
Lionel