Merge branch 'develop' of ssh://gitlab.datenpol.at:122/odoo/tz-austria into develop

develop
Andreas Brückl 2017-12-07 16:20:58 +01:00
commit 3f644e084e
4 changed files with 24 additions and 1 deletions

View File

@ -13,9 +13,12 @@
<field name="country_id" search="[('code','=','AT')]"/>
<field name="vat">ATU17860303</field>
<field name="vat_check_vies" eval="False"/>
<field name="supplier" eval="True"/>
</record>
<function id="set_company_supplier" model="res.company" name="set_company_supplier">
<value eval="[ref('glaser_and_co_company')]"/>
</function>
<function id="set_company_logo" model="res.company" name="set_company_logo">
<value eval="[ref('glaser_and_co_company')]"/>
<value>../static/src/img/logo_glaser.png</value>

View File

@ -16,4 +16,8 @@
(4,ref('queue_job.group_queue_job_manager'))]"/>
</record>
<function id="set_company_customer" model="res.company" name="set_company_customer">
<value eval="[ref('base.main_company')]"/>
</function>
</odoo>

View File

@ -36,6 +36,14 @@ class Company(models.Model):
fi.close()
self.browse(company).write({'logo': content})
@api.model
def set_company_supplier(self, company):
self.browse(company).partner_id.supplier = True
@api.model
def set_company_customer(self, company):
self.browse(company).partner_id.customer = True
@api.model
def set_company_favicon(self, company, logo):
filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), logo)

View File

@ -198,6 +198,14 @@ class SaleOrderLine(models.Model):
from_designbox = fields.Boolean(string='Import von Designbox', readonly=True)
product_id = fields.Many2one(domain=[('sale_ok', '=', True), ('can_be_sold_unconfigured', '=', True)])
@api.multi
def write(self, vals):
for record in self:
if record.from_designbox and set(vals.keys()).intersection(
['product_uom_qty', 'product_uom', 'price_unit']):
raise ValidationError(_("Menge und Preis können von Produkten aus der Designbox nicht geändert werden"))
return super(SaleOrderLine, self).write(vals)
@api.model
def correct_values(self, vals):
if vals.get('product_id', False):