Skip to content

Commit

Permalink
cambios a odoo 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Diegoivanc committed Dec 28, 2018
1 parent 43b9ce2 commit 4d699dd
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 19 deletions.
Empty file modified LICENSE
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion __manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
'data': [
'views/pos_view.xml',
],
'qweb': ['static/src/xml/*.xml'],
'qweb': ['static/src/xml/pos.xml'],
'installable': True,
}
Empty file modified models/__pycache__/__init__.cpython-36.pyc
100644 → 100755
Empty file.
Binary file added models/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Empty file modified models/__pycache__/point_of_sale.cpython-36.pyc
100644 → 100755
Empty file.
Binary file added models/__pycache__/point_of_sale.cpython-37.pyc
Binary file not shown.
Empty file modified models/point_of_sale.pyc
100644 → 100755
Empty file.
Empty file modified security/ir.model.access.csv
100644 → 100755
Empty file.
26 changes: 20 additions & 6 deletions static/src/js/sequence.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
odoo.define('l10n_co_pos_tax.main', function(require) {
odoo.define('l10n_co_pos_tax.sequence', function(require) {
"use strict";

var rpc = require('web.rpc');
var models = require('point_of_sale.models');

var core = require('web.core');
var screens = require('point_of_sale.screens');
var models = require('point_of_sale.models');
var devices = require('point_of_sale.devices');
var chrome = require('point_of_sale.chrome');
var gui = require('point_of_sale.gui');
var popups = require('point_of_sale.popups');
var Class = require('web.Class');
var utils = require('web.utils');
var PosBaseWidget = require('point_of_sale.BaseWidget');
var Model = require('web.DataModel');
var _t = core._t;
//var Model = require('web.DataModel');
var rpc = require('web.rpc');




var _t = core._t;
models.load_models([
{
model: 'ir.sequence',
fields: ['prefix','remaining_numbers', 'remaining_days', 'dian_resolution_ids'],
domain: function(self){ return ['|', ['name', 'in', self.config.sequence_id],
['name', 'in', self.config.sequence_refund_id]]; },
loaded : function(self, sequences) {
console.log('aquiiiiiiiaaaa');
console.log('aquiiiiiiiaaaa');
console.log('aquiiiiiiiaaaa');
console.log('aquiiiiiiiaaaa');
self.dian_resolution = sequences[0];
self.dian_resolution_refund = sequences[1];

Expand Down Expand Up @@ -117,8 +124,10 @@ odoo.define('l10n_co_pos_tax.main', function(require) {
return _super;
},
export_for_printing: function() {
console.log(this.pos.company_partner);
console.log(this.pos.dian_resolution_sequence);
var receipt = __super__.export_for_printing.apply(this);
var company_partner = this.pos.company_partner[0];
var company_partner = this.pos.company_partner;
var dian_resolution_sequence;

if(this.get_total_with_tax() < 0) {
Expand All @@ -134,6 +143,10 @@ odoo.define('l10n_co_pos_tax.main', function(require) {
receipt.company.street = "compañía sin dirección";
}





if( dian_resolution_sequence != undefined ){
if(dian_resolution_sequence.active_resolution != false) {
function zero_pad(num,size){
Expand All @@ -153,6 +166,7 @@ odoo.define('l10n_co_pos_tax.main', function(require) {


receipt.company.formatedNit = company_partner.formatedNit ? company_partner.formatedNit : "no posee";
//receipt.company.formatedNit = "no posee";

if (!this.number_next_dian) {
receipt.number_next_dian = this.number_next_dian;
Expand Down
10 changes: 5 additions & 5 deletions static/src/xml/pos.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<t t-if='receipt.total_with_tax &gt; 0'>
Factura de Venta No.:
</t>
<t t-if="widget.pos.dian_resolution_sequence.active_resolution">
<t t-if="receipt.dian_resolution_sequence.active_resolution">
<t t-if='receipt.total_with_tax &gt; 0'>
<t t-esc="order.number_next_dian" />
</t>
Expand All @@ -63,7 +63,7 @@


</t>
<t t-if="! widget.pos.dian_resolution_sequence.active_resolution">
<t t-if="! receipt.dian_resolution_sequence.active_resolution">
<t t-esc="order.get_name()" />
</t>

Expand Down Expand Up @@ -251,7 +251,7 @@
<t t-if='receipt.total_with_tax &lt; 0'>
<b>Devolución No.:</b>
</t>
<t t-if="widget.pos.dian_resolution_sequence.active_resolution">
<t t-if="receipt.dian_resolution_sequence.active_resolution">
<t t-if='receipt.total_with_tax &gt; 0'>
<t t-esc="order.number_next_dian" />
</t>
Expand All @@ -262,13 +262,13 @@


</t>
<t t-if="! widget.pos.dian_resolution_sequence.active_resolution">
<t t-if="! receipt.dian_resolution_sequence.active_resolution">
<t t-esc="order.get_name()" />
</t><br />


<t t-if='receipt.total_with_tax &gt; 0'>
<t t-if="widget.pos.dian_resolution_sequence.active_resolution">
<t t-if="receipt.dian_resolution_sequence.active_resolution">
<br />
Rango Facturación <t t-esc="receipt.dian_resolution_sequence.number_from" /> hasta <t t-esc="receipt.dian_resolution_sequence.number_to" /><br />
Autorización DIAN número: <t t-esc="receipt.dian_resolution_sequence.resolution_number" /><br />
Expand Down
12 changes: 5 additions & 7 deletions views/pos_view.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?xml version="1.0"?>
<openerp>
<data>
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<template id="l10n_co_pos_tax_js" name="l10n colombia pos tax assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<!-- <script type="text/javascript" src="/l10n_co_pos_res_partner/static/src/js/main.js"></script>-->
<script type="text/javascript" src="/l10n_co_pos_tax/static/src/js/sequence.js"></script>
<script type="text/javascript" src="/l10n_co_pos_tax/static/src/js/sequence.js"/>
<link rel="stylesheet" href="/l10n_co_pos_tax/static/src/css/pnpos.css" type="text/css"/>
</xpath>
</template>


<record model="ir.ui.view" id="view_pos_config_form">
<field name="name">pos.config.form.view</field>
<field name="model">pos.config</field>
Expand All @@ -21,5 +20,4 @@
</field>
</record>

</data>
</openerp>
</odoo>

0 comments on commit 4d699dd

Please sign in to comment.