2018-10-25 14:42:48 +02:00
|
|
|
# Part of Flectra. See LICENSE file for full copyright and licensing details.
|
|
|
|
|
|
|
|
from flectra import fields, models, api
|
|
|
|
|
|
|
|
|
|
|
|
class PurchaseOrder(models.Model):
|
|
|
|
_inherit = 'purchase.order'
|
|
|
|
|
|
|
|
@api.multi
|
|
|
|
def _default_config_type(self):
|
|
|
|
return self.vat_config_type.search([
|
|
|
|
('journal_id.type', '=', 'purchase')], limit=1)
|
|
|
|
|
|
|
|
vat_config_type = fields.Many2one(
|
2018-12-03 07:47:45 +01:00
|
|
|
'vat.config.type', 'VAT Type', default=_default_config_type,
|
2018-10-25 14:42:48 +02:00
|
|
|
readonly=True, states={'draft': [('readonly', False)]})
|
|
|
|
reverse_charge = fields.Boolean(
|
|
|
|
'Reverse Charge', readonly=True,
|
|
|
|
states={'draft': [('readonly', False)]})
|