adhoc-dev / odoo-addons

DEPRECEATED, see README
GNU Affero General Public License v3.0
71 stars 124 forks source link

Purchase tax fix #279

Closed aitorbouzas closed 6 years ago

aitorbouzas commented 6 years ago

Hello,

This is not an issue, is just a change I made in my environment because I had a problem i'll explain briefly now:

  1. I have website_sale installed and users from different companies (note that this is a multi company env) are allowed to make purchases in it.
  2. Since this is multi company there was a problem when the sale was created because the admin user (responsible to create the sale order from the website) added multiple taxes to each line
  3. I changed website_sale to use another user able to use only the central company taxes.
  4. When the sale is confirmed it automatically tries to create a purchase order to the company of the consignee with the website sales user.
  5. The problem was that this user could not use the taxes of the purchase company, so I changed this line company_taxes = [tax_rec.id for tax_rec in taxes if tax_rec.company_id.id == company.id] For this company_taxes = self.env['ir.values'].get_default('product.template', 'supplier_taxes_id', company_id=company.id)

In the inter_company_rules/models/sale_order.py at the _prepare_purchase_order_line_data.

Now it works nicely. Maybe using that code you fix any other possible issues with the taxes?

jjscarafia commented 6 years ago

Hi, thanks for reaching us.

  1. this organization "adhoc-dev" is only for internal use, the right one and the production one, is "ingadhoc"
  2. I believe that you're talking about a v8 module, we have stopped developing under v8 so we are not going to make changes on that version (Except some serious bug)

Hope you understand, Thanks, Juan