Join Github Today: Addons Account Models
Join Github Today: Addons Account Models
Dismiss
Join GitHub today
GitHub is home to over 40 million developers working together to
host and review code, manage projects, and build software together.
Sign up
4 contributors
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/account/models/product.py#L25 1/3
3/3/2020 odoo/product.py at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/account/models/product.py#L25 2/3
3/3/2020 odoo/product.py at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
48 if dict(self._cr.fetchall()) != uoms:
49 products = self.env['product.product'].search([('product_tmpl_id', 'in', self.ids)])
50 if self.env['account.move.line'].search_count([('product_id', 'in', products.ids)]):
51 raise UserError(_('You can not change the unit of measure of a product that has been already used in an acc
52 return res
53
54 @api.multi
55 def _get_product_accounts(self):
56 return {
57 'income': self.property_account_income_id or self.categ_id.property_account_income_categ_id,
58 'expense': self.property_account_expense_id or self.categ_id.property_account_expense_categ_id
59 }
60
61 @api.multi
62 def _get_asset_accounts(self):
63 res = {}
64 res['stock_input'] = False
65 res['stock_output'] = False
66 return res
67
68 @api.multi
69 def get_product_accounts(self, fiscal_pos=None):
70 accounts = self._get_product_accounts()
71 if not fiscal_pos:
72 fiscal_pos = self.env['account.fiscal.position']
73 return fiscal_pos.map_accounts(accounts)
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/account/models/product.py#L25 3/3